Re: math error
- From: "Jürgen Exner" <jurgenex@xxxxxxxxxxx>
- Date: Wed, 24 Aug 2005 02:27:10 GMT
Marshall Dudley wrote:
[code snipped]
> Should print the decimal part of .03, but gives this instead:
>
> 0.0300000000000002
>
> What am I doing wrong?
Using floating point arithmetic for precision calculations?
You must have missed the first lesson in computer numerics: "Thou shalt not
use floating point if expecting accurate results."
Anyway, see "perldoc -q 999" and DejaNews/Google for numerous discussions
about this topic.
jue
.
- References:
- math error
- From: Marshall Dudley
- math error
- Prev by Date: Re: math error
- Next by Date: building mod_perl in a temp build dir
- Previous by thread: Re: math error
- Next by thread: building mod_perl in a temp build dir
- Index(es):