WebDrake / Rational

std.rational Phobos candidate module
2 stars 0 forks source link

std.rational should support BigFloat as well as BigInt #7

Open WebDrake opened 11 years ago

WebDrake commented 11 years ago

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.