Reader mail bag
Kevin Bourrillion
kevinb at google.com
Thu Jun 1 17:46:43 UTC 2023
On Thu, Jun 1, 2023 at 10:35 AM Brian Goetz <brian.goetz at oracle.com> wrote:
Rational is unfortunate because the default representation (when used
> improperly) can lead to DBZE, but has a sensible default of zero -- except
> for that pesky denominator. However, I think this is a removable
> discontinuity, where the author can make up for this with some careful
> coding:
>
It helps a bit that you want to canonicalize all 0/n to *something* anyway,
and rational operations are already busy taking the gcd and ensuring
positive denominator as it is. The need to internally represent zero as 0/0
probably adds little incremental pain in *this* case, but there will be
others where it does. Still, overall it seems like a very fine trade-off.
--
Kevin Bourrillion | Java/Kotlin Ecosystem Team | Google, Inc. |
kevinb at google.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-spec-observers/attachments/20230601/e97a5d6a/attachment.htm>
More information about the valhalla-spec-observers
mailing list