kotlin-math
1.5.3
kotlin-math
/
dev.romainguy.kotlin.math
/
Rational
Rational
@
JvmInline
value
class
Rational
(
r
:
Long
)
:
Comparable
<
Rational
>
(
source
)
Types
Constructors
Functions
Properties
Extensions
Constructors
Rational
Link copied to clipboard
fun
Rational
(
r
:
Long
)
Types
Companion
Link copied to clipboard
object
Companion
Functions
compare
To
Link copied to clipboard
open
operator override
fun
compareTo
(
other
:
Rational
)
:
Int
component1
Link copied to clipboard
fun
component1
(
)
:
Int
component2
Link copied to clipboard
fun
component2
(
)
:
Int
div
Link copied to clipboard
operator
fun
div
(
other
:
Rational
)
:
Rational
is
Finite
Link copied to clipboard
fun
isFinite
(
)
:
Boolean
is
Infinite
Link copied to clipboard
fun
isInfinite
(
)
:
Boolean
is
Na
N
Link copied to clipboard
fun
isNaN
(
)
:
Boolean
is
Zero
Link copied to clipboard
fun
isZero
(
)
:
Boolean
minus
Link copied to clipboard
operator
fun
minus
(
other
:
Rational
)
:
Rational
plus
Link copied to clipboard
operator
fun
plus
(
other
:
Rational
)
:
Rational
times
Link copied to clipboard
operator
fun
times
(
other
:
Rational
)
:
Rational
to
Double
Link copied to clipboard
fun
toDouble
(
)
:
Double
to
Float
Link copied to clipboard
fun
toFloat
(
)
:
Float
to
Int
Link copied to clipboard
fun
toInt
(
)
:
Int
to
Long
Link copied to clipboard
fun
toLong
(
)
:
Long
to
String
Link copied to clipboard
open
override
fun
toString
(
)
:
String
unary
Minus
Link copied to clipboard
operator
fun
unaryMinus
(
)
:
Rational
unary
Plus
Link copied to clipboard
operator
fun
unaryPlus
(
)
:
Rational
Properties
denominator
Link copied to clipboard
val
denominator
:
Int
numerator
Link copied to clipboard
val
numerator
:
Int
sign
Link copied to clipboard
val
sign
:
Int
Extensions
to
Half
Link copied to clipboard
fun
Rational
.
toHalf
(
)
:
Half
Returns the half-precision float value represented by the specified
Rational
.