Could we have mod in std.math?

Don nospam at nospam.com
Sun Dec 25 22:57:07 PST 2011


On 24.12.2011 22:12, bearophile wrote:
> Caligo:
>
>> I'm hoping to see something like the above mod function in Phobos someday.
>
> I'd like that, for both int/long/BigInts. And I'd like some functions for BigInts:
> - divmod: returns both % and div and %, but it's more efficient if you need both values;
> - gcd

These should both exist for int and long as well.

> - pow: with a third optional argument (like in Python pow built-in) to quickly compute (x ^^ y) % z.
>
> Bye,
> bearophile



More information about the Digitalmars-d mailing list