Apache JDO Project - [jira] Commented: (JDO-206) JDOQL test NotEquals comparing floating point numbers

This is Interesting: Free IT Magazines  
Home > Archive > Apache JDO Project > December 2005 > [jira] Commented: (JDO-206) JDOQL test NotEquals comparing floating point numbers





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [jira] Commented: (JDO-206) JDOQL test NotEquals comparing floating point numbers
Erik Bengtson (JIRA)

2005-12-12, 5:45 pm

[ http://issues.apache.org/jira/brows...action_12360212 ]

Erik Bengtson commented on JDO-206:
-----------------------------------

one more test, shows that the double converted back to float prints the expected value. More, it seems to be a "normal" floating point numbers behaviour.. In conclusion, I think it's a bug in derby that should not convert that value to double when storin
g.

See

http://www.cygnus-software.com/pape...aringfloats.htm
http://stevehollasch.com/cgindex/coding/ieeefloat.html



public class Test
{

/**
* @param args
*/
public static void main(String[] args)
{
float f=(float)-234.23;
double d=(double)f;
float f1=(float)d;
System.out.println(f); //prints -234.23
System.out.println(d); // -234.22999572753906
System.out.println(f1); // -234.23
}

}


> JDOQL test NotEquals comparing floating point numbers
> -----------------------------------------------------
>
> Key: JDO-206
> URL: http://issues.apache.org/jira/browse/JDO-206
> Project: JDO
> Type: Bug
> Components: tck20
> Reporter: Andy Jefferson
> Assignee: Erik Bengtson


>
> The current TCK test (carried over from JDO 1.0) for NotEquals, uses != operator on floating point numbers. This is not a good practice, and is unreliable. Its probably the case that the Equals test uses == on the same content, which also is not a good

idea (as noted in the latest spec). These tests need reviewing and a reliable alternate strategy adopting

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secur...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com