of

fun of(n: Long): Rational

The whole number n as n/1.


fun of(numerator: Long, denominator: Long): Rational

The reduced rational numerator/denominator. The sign is normalized so the stored denominator is always positive; the fraction is reduced to lowest terms so equal values are structurally equal (equals/compareTo agree).

Throws