phobos
phobos copied to clipboard
BigInt divMod loops infinitely when dividing by zero
import std.bigint;
void main()
{
BigInt quotient, remainder;
divMod(
dividend: BigInt("1234"),
divisor: BigInt(0),
quotient: quotient,
remainder: remainder
);
}
Hangs; should throw an exception or error instead.
This affects not just divMod, any BigInt operation involving division by zero will loop infinitely:
import std;
void main()
{
BigInt x = BigInt(100) / BigInt(0); // infinite loop
}