octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MOD and REM


From: Alois Schloegl
Subject: MOD and REM
Date: Fri, 30 Jan 2004 16:58:21 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)


Usually, abs(R)<abs(Y) holds for any R = MOD(X,Y).
Therefore, I'd have expected this result:
> mod(5,[0,inf])
ans =
    0     5


But Octave (as well as ML) delivers

octave:7> mod(5,[0,inf])
ans =
    5   NaN

Has anybody a good explanation for this *strange* behaviour?
(The argument, because ML is doing it, does not qualify).


The alternative MOD and REM are included in
octave-forge/extra/NaN/
in case somebody wants to try them.


Alois




reply via email to

[Prev in Thread] Current Thread [Next in Thread]