RFR: 8279986: methods Math::asXExact for safely checked primitive casts

Michael Hixson duke at openjdk.java.net
Thu May 5 15:11:17 UTC 2022


On Thu, 5 May 2022 14:32:36 GMT, Raffaello Giulietti <duke at openjdk.java.net> wrote:

> So, what is the use case or the rationale for throwing on -0.0?

Rationale: It loses information.  It truncates the sign, so the value can't be round-tripped.  I think it would be the only lossy transformation permitted by the `to*Exact` methods?

Use case: None.  I haven't worked on a program where -0.0 -> OL -> +0.0 would have caused me a problem.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8548


More information about the core-libs-dev mailing list