# rem Classic List Threaded 4 messages Open this post in threaded view
|

## rem

 Hello, 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. Charles Suprin --- ... My name is Ozymandias, king of kings. Look on my works, ye Mighty, and despair. ...                         "Ozymandias"                         P.B. Shelly
Open this post in threaded view
|

## rem

 On 19-Nov-1997, Charles E. Suprin <[hidden email]> 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