Math

external object Math (source)

Platform and version requirements: JS

Exposes the JavaScript Math object to Kotlin.

Properties

PI

val PI: Double

Functions

abs

fun abs(value: Double): Double

acos

fun acos(value: Double): Double

asin

fun asin(value: Double): Double

atan

fun atan(value: Double): Double

atan2

fun atan2(y: Double, x: Double): Double

ceil

fun ceil(value: Number): Int

cos

fun cos(value: Double): Double

exp

fun exp(value: Double): Double

floor

fun floor(value: Number): Int

log

fun log(value: Double): Double

max

fun max(vararg values: Int): Int
fun max(vararg values: Float): Float
fun max(vararg values: Double): Double

min

fun min(vararg values: Int): Int
fun min(vararg values: Float): Float
fun min(vararg values: Double): Double

pow

fun pow(base: Double, exp: Double): Double

random

fun random(): Double

round

fun round(value: Number): Int

sin

fun sin(value: Double): Double

sqrt

fun sqrt(value: Double): Double

tan

fun tan(value: Double): Double

Inherited Functions

equals

open operator fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:

hashCode

open fun hashCode(): Int

Returns a hash code value for the object. The general contract of hashCode is:

toString

open fun toString(): String

Returns a string representation of the object.

Extension Functions

max

fun Math.max(a: Long, b: Long): Long

Returns the greater of two values.

min

fun Math.min(a: Long, b: Long): Long

Returns the smaller of two values.