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

Home » Public Forums » archive » Re: Modulo in IDL
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 in IDL [message #11006] Mon, 23 February 1998 00:00
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
> Modulo should work for all datatypes!

It does. The problem is that it's impossible to represent the
value of 0.1 exactly in the binary system (other than BCD, that is!).

Try 1.0 mod .25, or 1.0 mod 1.5258789062500e-5 for that matter
(the latter is 2^(-16)).

This is definitely *not* a bug, it's a generic feature of the binary
representation of numbers. Some of your examples will give different
results when you use doubles instead of floats, BTW.

Stein Vidar
[Message index]
 
Read Message
Previous Topic: Making a square plot
Next Topic: Modulo in IDL

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

Current Time: Sat Oct 11 09:30:32 PDT 2025

Total time taken to generate the page: 1.59678 seconds