Vladimir Bulatov wrote:
>
> Hi,
> I know, this question arises again and again.
> Just another example, which I run in yesterday.
>
> Script {
> field SFFloat number 0.2
> url[
> "javascript:
> function initialize(){
> print("0.2 = " + number);
> }
> "
> ]
> }
>
> result of execution of this Script in Cosmo2.0 is:
>
> 0.2 = .20000000298023224
>
> And this is perfectly correct from processor's point of view,
> but looks a little bit strange for human.
> Isn't it stupid to work with floats, when processor
> works with doubles?
> When memory is a little more than a dollar per megabite
> it is not worth to save memory for the price of
> having the whole bunch of other troubles.
> I think, that simplest solution - not to introduce new types,
> but just to assume, that all SFFloats are really doubles.
>
> Floats are bad heritage of old days, when every byte was
> counted. Floats are OK only for visual effects, not for
> any kind of technical applications of VRML.
>
> What think browsers' developers?
>
Using doubles everywhere would kill us. Floats aren't just used to save
space, they are much faster to process. Actual the word "double" is very
appropriate for this situation. They would double the time it takes to
convert coordinates which would double the time it takes to render a
scene!
Of course, some simple scenes are pixel fill-rate bound, but any world
with a significant number of polygons (over 500 or so) would suffer
noticably.
Doubles - bad.
Floats - good!
--
Chris Marrin | VRML Architect | phone: (510) 796-0443
chris@marrin.com | Silicon Graphics, Inc. | http://www.marrin.com/
[ "As a general rule, don't solve puzzles that open portals to Hell." ]
[ - excerpt from "A Horror Movie Character's Survival Guide" ]
-------------------------------------------------------------------------
for list subscription instructions,
send email to www-vrml-request@vrml.org with text "info"