Re: fractional cents

"Keith C. Ivey" <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
A. Pagaltzis <[email protected]> wrote:

> So if your conditional refers to $amt, it should use math, like
> ($amt * 1000) % 10.

Math won't work, because floats aren't exact.  I just ran this 
(Perl 5.6.1 on Windows 2000):

perl -le"($_/=100)&&($_*1000)%10&&print for 0..1000"

The output was

2.01
2.03
4.02
4.06
8.03
8.04
8.11
8.12
8.19

-- 
Keith C. Ivey <[email protected]>
Washington, DC
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.