On Wed, 26 Apr 2023 08:30:07 GMT, Raffaello Giulietti <rgiulie...@openjdk.org> wrote:
> No, that would not be correct. It would be subject to [double > rounding](https://en.wikipedia.org/wiki/Rounding#Double_rounding), against > the spec. > > For example, `BigDecimal` 1.000000059604644775390626 should round to `float` > `1.0000001f`. When going to the closest `double` and then to the closest > `float`, however, it first rounds to `double` `1.0000000596046448` and the to > `float` `1.0f`. Ah right; thanks for the correction -- since the set of possible inputs in this case isn't constrained by operations on float values, the 2p+2 property that hold for {+, -, *, /, sqrt} doesn't hold here. > I have no objections as long as it is a 1 letter name that does not conflict > with others. Have you a preferred one? I usually use "bd" or "bi" for such BigDecima/BigInteger variables myself and use "d" for double; "v" or "w" have integer-ish feel to me so perhaps one of those? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/9410#discussion_r1179424759 PR Review Comment: https://git.openjdk.org/jdk/pull/9410#discussion_r1179432887