ParallelGraphics Forums
Cortona VRML Client
You are here: [Forums]::[Browsers]::[Cortona VRML Client]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
Try RobinZone!
email:  password:
   Browsers - Cortona VRML Client

Subject: Re: strange floating point behaviour (bug?)
Sender: nalex@parallelgraphics.com 17.07.07 06:34
However, the value of Twist[3] is not 3.14; it's 3.140000104904175. What's even stranger is that the value of Twist is 0 1 0 3.14 !!

As said by wikipedia, "floating-point numbers cannot faithfully mimic the real numbers" and "floating-point operations cannot faithfully mimic true arithmetic operations". http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
And the situation is worse because of different precision levels of floating-point numbers in VRML engine and javascript interpretter. VRML engine uses 32 bit IEEE floating-points number, while javascript numbers are always 64 bit IEEE.

You should never compare two floating-point numbers for equality with '=='. It may works, but in general, the results are unpredictable.

 


strange floating point behaviour (bug?) / normca@yahoo.ca / 16.07.07 11:49
     Re: strange floating point behaviour (bug?) / nalex@parallelgraphics.com / 17.07.07 06:34

Messages in thread: 2


© 1998-2007 ParallelGraphics. All rights reserved. Terms of use.