Commit d39685e5 authored by Robert Griesemer's avatar Robert Griesemer
Browse files

[dev.typeparams] go/constant: choose internal float representations more consistently

go/constant represents a Float constant either as a rational number
(if numerator and denominator are small enough), or, as a "catch-all",
as a arbitrary-precision floating-point number.

This CL cleans up some of these transitions by factoring out more
of the decision logic and documents the rationale between the state
transitions better.

This CL also simplifies some unrelated code that was overly complex.

Updates #43908.

Change-Id: Iccdd2d6b7fb7ed13d68ed5e6d992d1bc56a065bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/286572


Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent 34704e37
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment