-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
Milestone
Description
Unsigned integer range handling has incorrectnesses / inconsistencies.
E.g. UInteger can be formed from integer -34 but not from long -34.
@Test
public void test_negative_uint_34il() {
UInteger a = uint(-34);
UInteger b = uint(-34L);
assertTrue (a == b);
}Reported error is Exception in thread "main" java.lang.NumberFormatException: Value is out of range : -34 for the b definition.
I would either expect both of the samples below to fail or succeed, but not act differently. What is the intent in this library? Shouldn't both these cases succeed, since -34 is a value that is representable in 32 bit signed integer?
Reactions are currently unavailable