Rationals Lib?

bearophile bearophileHUGS at lycos.com
Sat Oct 10 11:25:28 PDT 2009


dsimcha:

>     auto f1 = fraction( BigInt("314159265"), BigInt("27182818"));

That's a nice example where bigint literals are useful.

Missing bigint literals, this looks shorter than your way to define f1:
auto f1 = fraction("314159265 / 27182818");
Or a little better, if/when structs can be assigned statically:
fraction f1 = q{314159265 / 27182818};

Bye,
bearophile



More information about the Digitalmars-d mailing list