Function invert [src]

Invert the numerator and denominator fields of a Rational. p/q => q/p.

Prototype

pub fn invert(r: *Rational) void

Parameters

r: *Rational

Source

pub fn invert(r: *Rational) void { Int.swap(&r.p, &r.q); }