[JAVA-3056] should Decimal128 implement Number and Comparable ? Created: 18/Oct/18  Updated: 27/Nov/18  Resolved: 27/Nov/18

Status: Closed
Project: Java Driver
Component/s: BSON
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Andrei Sereda Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates JAVA-2860 Decimal128 should extend Number and i... Closed

 Description   

BigDecimal and BigInteger both implement Number and Comparable.

Any reason why Decimal128 doesn't follow suit ?



 Comments   
Comment by Jeffrey Yemin [ 27/Nov/18 ]

Closing as a duplicate of JAVA-2860

Comment by Jeffrey Yemin [ 18/Oct/18 ]

I think we can do by handling positive/negative infinity and NaN similar to the way Float does, e.g.:

assertEquals(Integer.MAX_VALUE, Float.valueOf(Float.POSITIVE_INFINITY).intValue());
assertEquals(Integer.MIN_VALUE, Float.valueOf(Float.NEGATIVE_INFINITY).intValue());
assertEquals(0, Float.valueOf(Float.NaN).intValue());

Generated at Thu Feb 08 08:58:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.