Kotlin.math to'plami
Matematik funksiyalar va konstantalar. Funksiyalarga trigonometrik, giperbolik, daraja va quvvat, logarifmik, yaxlitlash, belgi va absolyut qiymat.
Xususiyatlari
absoluteValue
Ushbu ifoda qiymatning absolyut qiymatini qaytaradi.
val Double.absoluteValue: Double
val Float.absoluteValue: Float
val Int.absoluteValue: Int
val Long.absoluteValue: Long
E
Tabiiy logarifmlar asosi, 2,71828.
const val E: Double
PI
Doira aylanasining uning diametriga nisbati, kelib chiqishi 3,14159.
const val PI: Double
sign
Ushbu ifoda qiymatning belgisini qaytaradi:
val Double.sign: Double
val Float.sign: Float
val Int.sign: Int
val Long.sign: Int
ulp
Ushbu ifoda qiymatning ulp (oxirgi o'rindagi birlik) ni qaytaradi.
val Double.ulp: Double
Ushbu ifoda qiymatning ulp qiymatini qaytaradi.
val Float.ulp: Float
Funksiyalar
abs
Berilgan x haqiqiy sonining absolyut qiymatini qaytaradi.
fun abs(x: Double): Double
fun abs(x: Float): Float
Berilgan n butun sonining absolyut qiymatini qaytaradi.
fun abs(n: Int): Int
fun abs(n: Long): Long
acos
x sonining yoy kosinusini hisoblaydi; Qaytarilgan qiymat - 0 va PI radianlar oralig'idagi burchak.
fun acos(x: Double): Double
fun acos(x: Float): Float
acosh
x sonining teskari giperbolik kosinusini hisoblaydi.
fun acosh(x: Double): Double
fun acosh(x: Float): Float
asin
x sonining yoy sinusini hisoblaydi; Qaytarilgan qiymat - -PI/2 va PI/2 radianlar oralig'idagi burchak.
fun asin(x: Double): Double
fun asin(x: Float): Float
asinh
x sonining teskari giperbolik sinusini hisoblaydi.
fun asinh(x: Double): Double
fun asinh(x: Float): Float
atan
x sonining yoy tangensini hisoblaydi; Qaytarilgan qiymat - -PI/2 va PI/2 radianlar oralig'idagi burchak.
fun atan(x: Double): Double
fun atan(x: Float): Float
atanh
x sonining teskari giperbolik tagensini hisoblaydi.
fun atanh(x: Double): Double
fun atanh(x: Float): Float
cbrt
x sonining kub ildizini qaytaradi. Har qanday x uchun cbrt(-x)=-cbrt(x) ya'ni manfiy qiymatning kub ildizi bu qiymat kattaligining kub ildizining manfiy qismiga tengdir.
fun cbrt(x: Double): Double
fun cbrt(x: Float): Float
ceil
Berilgan x sonini musbat cheksizlik tomon butun songa yaxlitlaydi.
fun ceil(x: Double): Double
fun ceil(x: Float): Float
cos
Radianlarda berilgan x ning kosinusini qaytaradi.
fun cos(x: Double): Double
fun cos(x: Float): Float
cosh
x radianning giperbolik kosinusini hisoblaydi .
fun cosh(x: Double): Double
fun cosh(x: Float): Float
exp
x Eyler sonini e darajasiga ko'taradi.
fun exp(x: Double): Double
fun exp(x: Float): Float
expm1
exp(x) ni - 1 darajasini hisoblaydi.
fun expm1(x: Double): Double
fun expm1(x: Float): Float
floor
Berilgan x sonini manfiy cheksizlik tomon butun songa yaxlitlaydi.
fun floor(x: Double): Double
fun floor(x: Float): Float
hypot
x va y sonlarining kvadratlar yig'indisini ildizga olib hisoblaydi. (sqrt(x2+y2))
fun hypot(x: Double, y: Double): Double
fun hypot(x: Float, y: Float): Float
ln
x sonining E natural logarifmini (asosini) hisoblaydi.
fun ln(x: Double): Double
fun ln(x: Float): Float
ln1p
ln(x + 1) ni hisoblaydi.
fun ln1p(x: Double): Double
fun ln1p(x: Float): Float
log
Berilgan x sonining logarifmini hisoblaydi.
fun log(x: Double, base: Double): Double
fun log(x: Float, base: Float): Float
log10
Berilgan x sonining o'nlik logarifmini hisoblaydi.
fun log10(x: Double): Double
fun log10(x: Float): Float
log2
Berilgan x sonining ikkilik logarifmini hisoblaydi.
fun log2(x: Double): Double
fun log2(x: Float): Float
max
Berilgan a va b sonlarning maksimal qiymatini qaytaradi.
fun max(a: UInt , b: UInt): UInt
fun max(a: ULong, b: ULong): ULong
fun max(a: Double, b: Double): Double
fun max(a: Float, b: Float): Float
fun max(a: Int, b: Int): Int
fun max(a: Long, b: Long): Long
min
Berilgan a va b sonlarning minimal qiymatini qaytaradi.
fun min(a: UInt, b: UInt):UInt
fun min(a: ULong, b: ULong):ULong
fun min(a: Double, b: Double): Double
fun min(a: Float, b: Float): Float
fun min(a: Int, b: Int): Int
fun min(a: Long, b: Long): Long
sign
Berilgan x ni belgisini qaytaradi.
fun sign(x: Double): Double
fun sign(x: Float): Float
sin
Radianlarda berilgan x ni burchak sinusini qaytaradi.
fun sin(x: Double): Double
fun sin(x: Float): Float
sinh
Berilgan x sonining giperbolik sinusini qaytaradi.
fun sinh(x: Double): Double
fun sinh(x: Float): Float
sqrt
Berilgan x sonini kvadrat ildizini qaytaradi.
fun sqrt(x: Double): Double
fun sqrt(x: Float): Float
tan
Radianlarda berilgan x ni burchak tangensini qaytaradi.
fun tan(x: Double): Double
fun tan(x: Float): Float
tanh
Berilgan x sonining giperbolik tangensini qaytaradi.
fun tanh(x: Double): Double
fun tanh(x: Float): Float
truncate
Berilgan x sonini butun songa yaxlitlaydi.
fun truncate(x: Double): Double
fun truncate(x: Float): Float
withSign
Bu qiymatni belgi bilan bir xil ishora biti bilan qaytaradi.
fun Double.withSign(sign: Double): Double
fun Double.withSign(sign: Int): Double
fun Float.withSign(sign: Float): Float
fun Float.withSign(sign: Int): Float