Constructs a Number.
Constructs a Number using precision only.
Applies an operator to a Number given the rhs.
The result of applying an operator to a Number.
Serializes a dstring to a Number.
Detrmine if two Numbers are equal.
Represents a Number as a dstring.
BigInt a = 1; immutable BigInt b = -1; immutable long c = 0; Number e = new Number(NumberContainer(a,b,c)); a = 2; Number f = new Number(NumberContainer(a,b,c)); e.applyOp("/", f); assert(e.val == NumberContainer(BigInt(6), BigInt(-2), -1L)); assert(e.toDstring == ".6-.2i"d); f = new Number(NumberContainer(BigInt(6), BigInt(0), 1L)); assert(f.toDstring == "60+00i"d); auto g = f.toDstring; f.fromDstring(g); assert(f.toDstring == g, cast(char[])f.toDstring.dup); f = new Number(NumberContainer(BigInt(6), BigInt(0), -2L)); assert(f.toDstring == ".06+.00i"d, cast(char[])f.toDstring.dup); g = f.toDstring; f.fromDstring(g); assert(g == f.toDstring); f = new Number(NumberContainer(BigInt(3), BigInt(6), -23L)); g = f.toDstring; f.fromDstring(g); assert(g == f.toDstring); f = new Number(NumberContainer(BigInt(6), BigInt(0), 0L)); assert(f.toDstring == "6+0i"d); f = new Number(NumberContainer(BigInt(60), BigInt(0), -1L)); assert(f.toDstring == "6.0+.0i"d, cast(char[])f.toDstring.dup);
Class to represent Numbers in dutils.