Error in the Float32.compare method
ChristianG
Posts: 29
Here is some code illustrating the error using the Float32.compare() method:
My previous topic on the subject has been delete...
Float32 vindMax = new Float32();
Float32 vind = new Float32();
VindMax.set("0.0");
vind.set("0.7");
System.out.println(vindMax.compare(vind)); // prints "1" witch is wrong!!!
vind.set("1.7");
System.out.println(vindMax.compare(vind)); // prints "-1" witch is correct!!!
It seems that comparing with values between zero and one gives the wrong result.
Could somebody try that?
Thanks
Post Edited (ChristianG) : 9/14/2004 8:07:25 PM GMT
My previous topic on the subject has been delete...
Float32 vindMax = new Float32();
Float32 vind = new Float32();
VindMax.set("0.0");
vind.set("0.7");
System.out.println(vindMax.compare(vind)); // prints "1" witch is wrong!!!
vind.set("1.7");
System.out.println(vindMax.compare(vind)); // prints "-1" witch is correct!!!
It seems that comparing with values between zero and one gives the wrong result.
Could somebody try that?
Thanks
Post Edited (ChristianG) : 9/14/2004 8:07:25 PM GMT
Comments
I just noticed your post from a couple of months ago. Yes, there was an error in the Float32.compare method. It was fixed in April, but Parallax still has the old zip file on the website. I'll get in touch with Parallax to try to get this resolved.
Regards,
Cam