std.rational is designed to work with (any) arbitrary-precision integer type, but its existing interaction with floating point neglects the possibility of arbitrary-precision floating point. For example, toRational assumes the input type is real.
Although Phobos currently has no BigFloat support, std.rational should be designed with this in mind. Best-case scenario is probably that the current "use real" approach can simply be replaced with a generic "any arbitrary-precision floating point" input in future.
std.rational
is designed to work with (any) arbitrary-precision integer type, but its existing interaction with floating point neglects the possibility of arbitrary-precision floating point. For example,toRational
assumes the input type isreal
.Although Phobos currently has no BigFloat support,
std.rational
should be designed with this in mind. Best-case scenario is probably that the current "usereal
" approach can simply be replaced with a generic "any arbitrary-precision floating point" input in future.