Difference

The difference between two compile-time rational numbers.

@safe
template Difference (
Lhs
Rhs
) if (
isRational!Lhs &&
isRational!Rhs
) {}

Examples

static assert(is(Difference!(Rational!(1, 2u), Rational!(1, 3u)) == Rational!(1, 6u)));
static assert(is(Difference!(Rational!3, Rational!1) == Rational!2));
static assert(is(Difference!(Rational!1, Rational!3) == Rational!(-2)));

Meta