Companion

object Companion

Properties

Link copied to clipboard

The rational 1/1.

Link copied to clipboard

The rational 0/1.

Functions

Link copied to clipboard

The larger of two rationals (a if equal).

Link copied to clipboard
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).