comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » modulo operator
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: modulo operator [message #86445 is a reply to message #86444] Fri, 08 November 2013 15:09 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
spluque@gmail.com writes:

> I'm a little confused by the following:
>
> IDL> print, 1200 MOD 0.1
> 0.0999821
> IDL> print, (1200 * 10.0) MOD (0.1 * 10)
> 0.00000
>
> I expected this to be 0 either way. What am I missing?

Almost certainly the way numbers are represented on computers:

http://www.idlcoyote.com/math_tips/sky_is_falling.html

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: strange !P.multi[0] behavior??
Next Topic: Feature request for DILATE function

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:09:53 PDT 2025

Total time taken to generate the page: 0.00485 seconds