Re: remainder() is not right

new topic     » goto parent     » topic index » view thread      » older message » newer message

> On 4 May 2008 at 6:16, CChris wrote (maybe snipped):

> The remainder of x by y, which remainder() is supposed to return, is
> the number with the smallest magnitude and the sign of y such that, if
> we call it z, x-z is a multiple of y.
> 
> But remainder() has a quirkier response. For instance:
> ?remainder(-27,3600) -- -27, instead of 3573
> ?remainder(-3627,3600) -- ditto
> ?remainder(-3627,-3600) -- -27 is correct here
> ?remainder(27,-3600)    -- 27, instead of -3573
> 

Chris, IMHO actual results are coherent to function's description 
found in Refman, or am I missing something? Isn't it supposed to 
return the remainder of division of the first element by the second?

Best,
Euler

-- 
_
_| euler f german
_| sete lagoas, mg, brazil
_| efgerman{AT}gmail{DOT}com
_| -----------------------------
_| Reply preferably to the list,
_| or to the address above. Thx!

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu