File tree 2 files changed +9
-3
lines changed
super/com/google/gwt/lang
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -431,9 +431,6 @@ public static String toBase64(long value) {
431
431
}
432
432
433
433
public static double toDouble (LongEmul a ) {
434
- if (LongLib .eq (a , Const .MIN_VALUE )) {
435
- return -9223372036854775808.0 ;
436
- }
437
434
if (LongLib .lt (a , Const .ZERO )) {
438
435
return -toDoubleHelper (LongLib .neg (a ));
439
436
}
Original file line number Diff line number Diff line change @@ -165,6 +165,15 @@ public void testConversions() {
165
165
assertEquals (-10 , LongLib .toInt (longFromBits (0 , -10 )));
166
166
assertEquals (-10 , LongLib .toInt (longFromBits (100 , -10 )));
167
167
assertEquals (-10 , LongLib .toInt (longFromBits (-100000 , -10 )));
168
+
169
+ assertEquals (0d , LongLib .toDouble (LongLib .fromInt (0 )));
170
+ assertEquals (1d , LongLib .toDouble (LongLib .fromInt (1 )));
171
+ assertEquals (10d , LongLib .toDouble (LongLib .fromInt (10 )));
172
+ assertEquals (-1d , LongLib .toDouble (LongLib .fromInt (-1 )));
173
+ assertEquals (-10d , LongLib .toDouble (LongLib .fromInt (-10 )));
174
+
175
+ assertEquals (-9.223372036854776E18 , LongLib .toDouble (Const .MIN_VALUE ));
176
+ assertEquals (9.223372036854776E18 , LongLib .toDouble (Const .MAX_VALUE ));
168
177
}
169
178
170
179
public void testDiv () {
You can’t perform that action at this time.
0 commit comments