mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
math: inf,nan,fmod for the JS backend (#11246)
This commit is contained in:
parent
70a658a265
commit
1570e613b5
10 changed files with 812 additions and 34 deletions
18
vlib/math/bits.js.v
Normal file
18
vlib/math/bits.js.v
Normal file
|
@ -0,0 +1,18 @@
|
|||
module math
|
||||
|
||||
pub fn inf(sign int) f64 {
|
||||
mut res := 0.0
|
||||
if sign >= 0 {
|
||||
#res.val = Infinity
|
||||
} else {
|
||||
#res.val = -Infinity
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn nan() f64 {
|
||||
mut res := 0.0
|
||||
#res.val = NaN
|
||||
|
||||
return res
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue