/
js.math.kt
98 lines (90 loc) · 4.3 KB
/
js.math.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package kotlin.js
/**
* Exposes the JavaScript [Math object](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Math) to Kotlin.
*/
@Deprecated("Use top-level functions from kotlin.math package instead.")
public external object Math {
@Deprecated("Use kotlin.math.PI instead.", ReplaceWith("PI", "kotlin.math.PI"))
public val PI: Double
public fun random(): Double
@Deprecated("Use kotlin.math.abs instead.", ReplaceWith("abs(value)", "kotlin.math.abs"))
public fun abs(value: Double): Double
@Deprecated("Use kotlin.math.acos instead.", ReplaceWith("acos(value)", "kotlin.math.acos"))
public fun acos(value: Double): Double
@Deprecated("Use kotlin.math.asin instead.", ReplaceWith("asin(value)", "kotlin.math.asin"))
public fun asin(value: Double): Double
@Deprecated("Use kotlin.math.atan instead.", ReplaceWith("atan(value)", "kotlin.math.atan"))
public fun atan(value: Double): Double
@Deprecated("Use kotlin.math.atan2 instead.", ReplaceWith("atan2(y, x)", "kotlin.math.atan2"))
public fun atan2(y: Double, x: Double): Double
@Deprecated("Use kotlin.math.cos instead.", ReplaceWith("cos(value)", "kotlin.math.cos"))
public fun cos(value: Double): Double
@Deprecated("Use kotlin.math.sin instead.", ReplaceWith("sin(value)", "kotlin.math.sin"))
public fun sin(value: Double): Double
@Deprecated("Use kotlin.math.exp instead.", ReplaceWith("exp(value)", "kotlin.math.exp"))
public fun exp(value: Double): Double
@Deprecated("Use maxOf or kotlin.math.max instead")
public fun max(vararg values: Int): Int
@Deprecated("Use maxOf or kotlin.math.max instead")
public fun max(vararg values: Float): Float
@Deprecated("Use maxOf or kotlin.math.max instead")
public fun max(vararg values: Double): Double
@Deprecated("Use minOf or kotlin.math.min instead")
public fun min(vararg values: Int): Int
@Deprecated("Use minOf or kotlin.math.min instead")
public fun min(vararg values: Float): Float
@Deprecated("Use minOf or kotlin.math.min instead")
public fun min(vararg values: Double): Double
@Deprecated("Use kotlin.math.sqrt instead.", ReplaceWith("sqrt(value)", "kotlin.math.sqrt"))
public fun sqrt(value: Double): Double
@Deprecated("Use kotlin.math.tan instead.", ReplaceWith("tan(value)", "kotlin.math.tan"))
public fun tan(value: Double): Double
@Deprecated("Use kotlin.math.log instead.", ReplaceWith("log(value)", "kotlin.math.log"))
public fun log(value: Double): Double
@Deprecated("Use kotlin.math.pow instead.", ReplaceWith("pow(base, exp)", "kotlin.math.pow"))
public fun pow(base: Double, exp: Double): Double
@Deprecated("Use kotlin.math.round instead.", ReplaceWith("round(value)", "kotlin.math.round"))
public fun round(value: Number): Int
@Deprecated("Use kotlin.math.floor instead.", ReplaceWith("floor(value)", "kotlin.math.floor"))
public fun floor(value: Number): Int
@Deprecated("Use kotlin.math.ceil instead.", ReplaceWith("ceil(value)", "kotlin.math.ceil"))
public fun ceil(value: Number): Int
@PublishedApi
internal fun trunc(value: Number): Double
@PublishedApi
internal fun sign(value: Number): Double
@PublishedApi
internal fun sinh(value: Double): Double
@PublishedApi
internal fun cosh(value: Double): Double
@PublishedApi
internal fun tanh(value: Double): Double
@PublishedApi
internal fun asinh(value: Double): Double
@PublishedApi
internal fun acosh(value: Double): Double
@PublishedApi
internal fun atanh(value: Double): Double
@PublishedApi
internal fun hypot(x: Double, y: Double): Double
@PublishedApi
internal fun expm1(value: Double): Double
@PublishedApi
internal fun log10(value: Double): Double
@PublishedApi
internal fun log2(value: Double): Double
@PublishedApi
internal fun log1p(value: Double): Double
}
/**
* Returns the smaller of two values.
*/
@Suppress("DEPRECATION")
@Deprecated("Use minOf or kotlin.math.min instead", ReplaceWith("minOf(a, b)"))
public fun Math.min(a: Long, b: Long): Long = if (a <= b) a else b
/**
* Returns the greater of two values.
*/
@Suppress("DEPRECATION")
@Deprecated("Use maxOf or kotlin.math.max instead", ReplaceWith("maxOf(a, b)"))
public fun Math.max(a: Long, b: Long): Long = if (a >= b) a else b