Closed MilesCranmer closed 1 year ago
What about, for example,
C = 2^8 * 3^6 * 5^4 * 7^2 * 11^2 * 13 * 15 # = 2385171360000
meaning you could represent any fraction which can be built by a combination of those powers. But you could not represent, say, 1/(15^2). But you could get awfully close.
The typemax
of this would be 188232082384791343//2752120800000
, which evaluates to ~68395
- again, likely more than anybody would need.
I really think the default should probably be Int8/6
. There are some cases where you need finer granularity than that, but they're pretty rare and I don't think they should be the default.
(Fixed by #21 but forgot to close this)
cc @oscardssmith
I think it would probably be much faster to use
Int64 / C
, for some choice of constantC
, than to useRational{Int16}
as is currently done – as it would avoid repeatedgcd
calls.We would want to pick some constant
C
such that most rationals expressed byRational{Int16}
that people would typically want to use could also be expressed this way.