Removed the call to doubleToRawLongBits()
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352828 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f42b7bbdbb
commit
f8d89add04
@ -386,7 +386,11 @@ public class LittleEndian
|
||||
|
||||
public static void putDouble(final byte[] data, final int offset,
|
||||
final double value) {
|
||||
putNumber(data, offset, Double.doubleToRawLongBits(value), DOUBLE_SIZE);
|
||||
// Excel likes NaN to be a specific value.
|
||||
if (Double.isNaN(value))
|
||||
putNumber(data, offset, -276939487313920L, DOUBLE_SIZE);
|
||||
else
|
||||
putNumber(data, offset, Double.doubleToLongBits(value), DOUBLE_SIZE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -166,9 +166,6 @@ public class TestLittleEndian
|
||||
assertEquals(_doubles[ 1 ], LittleEndian.getDouble( _double_array, LittleEndian.DOUBLE_SIZE), 0.000001);
|
||||
assertTrue(Double.isNaN(LittleEndian.getDouble(_nan_double_array)));
|
||||
|
||||
// does not work. apparently nan does not always equal nan!
|
||||
//assertEquals(_doubles[ 2 ], LittleEndian.getDouble(_nan_double_array), 0.000001);
|
||||
|
||||
double nan = LittleEndian.getDouble(_nan_double_array);
|
||||
byte[] data = new byte[8];
|
||||
LittleEndian.putDouble(data, nan);
|
||||
|
Loading…
Reference in New Issue
Block a user