Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

674: add integer types to array processing #676

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,12 @@ private static boolean sameContent (Number number, String constant_repr) {
return true;
}
if (number instanceof BigDecimal) number = ((BigDecimal)number).doubleValue();
if (number instanceof Byte) number = BigInteger.valueOf(number.byteValue());
if (number instanceof Double) number = BigInteger.valueOf(Double.doubleToRawLongBits((Double)number));
if (number instanceof Float) number = BigInteger.valueOf(Float.floatToRawIntBits((Float)number) & 0xFFFFFFFFL);
if (number instanceof Integer) number = BigInteger.valueOf(number.intValue());
if (number instanceof Long) number = BigInteger.valueOf(number.longValue());
if (number instanceof Short) number = BigInteger.valueOf(number.shortValue());
BigInteger constant = SpecialConstantBitPatternTransforms.asBigInt(constant_repr);
BigInteger value = (BigInteger)number;
return constant.xor (value).longValue() == 0L;
Expand Down