You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to distinguish a number such as 1 from 1.0. Specifically, the latter has more precision. I think this information could be retrieved from the scale/precision information in the BigDecimal, but there isn't an accessor for the scale. Is there a reason not to add one?
The text was updated successfully, but these errors were encountered:
No I don't see why it wasn't included. Both scale() and precision() are implemented in the BigDecimal standards of Java & Scala, only precision() is present in Go, Ruby, and GMP, so I pause and wonder if scale is an implementation detail, but I suppose it could always be calculated.
In terms of utility, sometimes it's important to know that even if two values are equal, that one has more precision due to extra significant figures. precision() should be equivalent to digits() based on the docs of both Java and this crate. scale is available via the as_bigint_and_exponent() method, as the exponent, so we should be able to expose it as a scale method as well
I'd like to be able to distinguish a number such as
1
from1.0
. Specifically, the latter has more precision. I think this information could be retrieved from the scale/precision information in the BigDecimal, but there isn't an accessor for the scale. Is there a reason not to add one?The text was updated successfully, but these errors were encountered: