math.v: Added more functions
Added almost all the functions present in C math libpull/417/head
parent
2c3b10da76
commit
ac4a4cbcc9
39
math/math.v
39
math/math.v
|
@ -15,10 +15,34 @@ fn abs(a f64) f64 {
|
|||
return a
|
||||
}
|
||||
|
||||
fn ceil(a f64) f64 {
|
||||
return C.ceil(a)
|
||||
}
|
||||
|
||||
fn cos(a f64) f64 {
|
||||
return C.cos(a)
|
||||
}
|
||||
|
||||
fn cosh(a f64) f64 {
|
||||
return C.cosh(a)
|
||||
}
|
||||
|
||||
fn exp(a f64) f64 {
|
||||
return C.exp(a)
|
||||
}
|
||||
|
||||
fn floor(a f64) f64 {
|
||||
return C.floor(a)
|
||||
}
|
||||
|
||||
fn log(a f64) f64 {
|
||||
return C.log(a)
|
||||
}
|
||||
|
||||
fn log10(a f64) f64 {
|
||||
return C.log10(a)
|
||||
}
|
||||
|
||||
fn max(a, b f64) f64 {
|
||||
if a > b {
|
||||
return a
|
||||
|
@ -49,7 +73,22 @@ fn sin(a f64) f64 {
|
|||
return C.sin(a)
|
||||
}
|
||||
|
||||
fn sinh(a f64) f64 {
|
||||
return C.sinh(a)
|
||||
}
|
||||
|
||||
fn sqrt(a f64) f64 {
|
||||
return C.sqrt(a)
|
||||
}
|
||||
|
||||
fn tan(a f64) f64 {
|
||||
return C.tan(a)
|
||||
}
|
||||
|
||||
fn tanh(a f64) f64 {
|
||||
return C.tanh(a)
|
||||
}
|
||||
|
||||
fn trunc(a f64) f64 {
|
||||
return C.trunc(a)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue