[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## rem

**From**: |
John W. Eaton |

**Subject**: |
rem |

**Date**: |
Fri, 21 Nov 1997 16:19:01 -0600 |

On 19-Nov-1997, Charles E. Suprin <address@hidden> wrote:
| This is a simple question. rem in octave claims to not do imaginary
| numbers. It commnets that the matlab one is a bunch of hooey.
| However the complex nature is used in the unwrap function. Has anyone
| implemented a matlab compatible rem function.
What is rem supposed to do for complex numbers? Can someone point me
to a textbook definition?
Matlab 4.2 provides what I think are some strange results:
>> rem (1,i)
ans =
NaN
>> rem (i, 1)
ans =
0
>> rem (i, 2)
ans =
0
>> rem (55+37i, 3+4i)
ans =
1
Note that these results are not the same as x - fix(x./y).*y (what the
help text suggests is used for computing rem(x,y) and which I don't
think would be correct for complex numbers anyway). Instead, it
appears that Matlab's rem function is discarding the imaginary parts
of its arguments. If that's the result you want, why not simply code
it explicitly?
Thanks,
jwe

**rem**, *Charles E. Suprin*, `1997/11/19`
**rem**,
*John W. Eaton* **<=**
**RE: rem**, *Ted Harding*, `1997/11/21`
**Re: rem**, *Raymond E. Rogers*, `1997/11/22`