Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: single-precision floats, etc.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-10-30 (07:21)
From: Chris Hecker <checker@d...>
Subject: Re: single-precision floats, etc.

>Just curious ... would single-precision floats have been accurate enough
>for the ICFP programming contest?

Most numerical analysis texts point out that you rarely need double precision floating point numbers for accuracy or precision if your algorithm is properly constructed.  Range is a different matter, but I doubt the raytracer world was the size of the solar system.  For any reasonably ranged problem, singles are fine.  Of course, this is like saying 16 bit ints are fine because you can do most algorithms with them if you're careful.  Eventually doubles will replace singles because hey, more range and precision is better, and computers are fast and ram is cheap.  Still, we don't store strings as arrays of 32 bit numbers because a) we don't need to, and b) it's wasteful.  So, I'd assume singles will be around for a long time to come.  Do you really need better than 10e-6 accuracy (that's about unit roundoff for a single).

>And how fast might they have been?

I can't answer that (assuming you were asking me about this in the first place).  Multiplies and adds are the same speed on most CPUs, so cache effects would have been the governing variable here.