Jump to content

Arithmetic/Rational: Difference between revisions

Small improvements in the D entry
(Updated D entry)
(Small improvements in the D entry)
Line 379:
}
 
struct RationalT(T) if (!isUnsigned!T) {
private T num, den; // Numerator & denominator.
 
Line 496:
}
 
intbool opEquals(U)(in U r) const pure nothrow {
RationalT rhs = RationalT(r);
if (type() == Type.NaRAT || rhs.type() == Type.NaRAT)
Line 503:
}
 
int opCmp(U)(in U r) const pure nothrow {
auto rhs = RationalT(r);
if (type() == Type.NaRAT || rhs.type() == Type.NaRAT)
Cookies help us deliver our services. By using our services, you agree to our use of cookies.