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 
Switch to threaded view of this topic 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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Making a square plot
Next Topic: Modulo in IDL

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

Current Time: Sun Oct 12 07:04:00 PDT 2025

Total time taken to generate the page: 2.48144 seconds