K*******1 发帖数: 85 | 1 if rem(n,2) == 1
n=3*n+1;
else
。。。
rem(n,2) == 1是啥意思?
Tks | f*******g 发帖数: 377 | 2 Remainder after division | S*********g 发帖数: 5298 | 3 >> help rem
REM Remainder after division.
REM(x,y) is x - n.*y where n = fix(x./y) if y ~= 0. If y is not an
integer and the quotient x./y is within roundoff error of an integer,
then n is that integer. The inputs x and y must be real arrays of the
same size, or real scalars.
By convention:
REM(x,0) is NaN.
REM(x,x), for x~=0, is 0.
REM(x,y), for x~=y and y~=0, has the same sign as x.
Note: MOD(x,y), for x~=y and y~=0, has the same sign as y.
【在 K*******1 的大作中提到】 : if rem(n,2) == 1 : n=3*n+1; : else : 。。。 : rem(n,2) == 1是啥意思? : Tks
| K*******1 发帖数: 85 | |
|