[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rem and mod
From: |
José Luis García Pallero |
Subject: |
Re: rem and mod |
Date: |
Thu, 26 Jun 2014 15:21:28 +0200 |
2014-06-26 12:45 GMT+02:00 Paul Soderlind <address@hidden>:
> Hi all,
>
> rem(0.94,0.01) gives the answer 0.01 (in 3.8.1-4 from mxeoctave.osuv.de, but
> also in other windows binaries), but I had expected to get 0. mod is
> similar.
>
> The reason seems to be related to that fix(0.94/0.01) = 93, since 0.94/0.01
> - 94 is evaluated to be -1.4211e-14. Clearly, floating point precision
> playing tricks. rem(94,1) does the right thing
>
> Is this to be expected? (...matlab gives 0 and Octave''s ) Would be good to
> know. Thanks
Octave 3.8.1 compiled by myself in Debian also gives the incorrect 0.01 answer
>
> Paul Söderlind
>
>
>
> --
> View this message in context:
> http://octave.1599824.n4.nabble.com/rem-and-mod-tp4665069.html
> Sent from the Octave - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-octave
--
*****************************************
José Luis García Pallero
address@hidden
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************