Matthew Ong wrote: > Hi Alexander, > > Is there anyway to ensure the comparison of float/double to be done with the > raw > bits like in Java > Double.doubleToRawLongBits(double value) > > http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Double.html#doubleToRawLongBits%28double%29 > > when it comes to financial data and percentage computation, that seems to be > rather important. > > Thanks in advance.
That's sounds a bit odd to me. I thought that in application code you should never compare floating points regarding equality. I only know of something similar in testing code where you compare equality within some number of ulps (unit of least precision). So your use case sounds interesting. Can you elaborate a bit? If you really want to to compare bit by bit it should be possible to cast the floating point values and then perform the comparison. Jens
