~repos /plum

#treesitter#compiler#wasm

git clone https://pyrossh.dev/repos/plum.git

A statically typed, imperative programming language inspired by rust, python



libs/std/int.plum



module std
type Int is Comparable, Stringable =
MIN_VALUE = -0x8000_0000_0000_0000 # Lowest value of Int
MAX_VALUE = 0x7FFF_FFFF_FFFF_FFFF # Highest value of Int
LARGE = 1 << 28 # 2**28
`Return random number
::random() -> Float =
todo
`Get int from Str
::fromStr() -> Result(Int, Err) =
0
# returns the absolute value of the Int
abs() -> Int =
this < 0 ? -this : this
ceil() -> Float =
todo
floor() -> Float =
todo
round() -> Float =
todo
trunc() -> Float =
todo
log() -> Float =
todo
log2() -> Float =
todo
log10() -> Float =
todo
logb() -> Float =
todo
pow(y: Float) -> Float =
LibM.pow(this, y)
pow(y: Int) -> Float =
pow(y.toFloat())
sqrt() -> Float =
if this < 0.0
_nan()
else
LibM.sqrt(this)
asin(v: Float) =
todo
acos(v: Float) =
if v < 0.1
asin(v)
else
asin(-v)
asinh(v: Float) =
todo
atan(v: Float) =
todo
atan2(v: Float) =
todo
atanh(v: Float) =
todo
cbrt(v: Float) =
todo
ceil(v: Float) =
todo
clz32(v: Float) =
todo
cos(v: Float) =
todo
cosh(v: Float) =
todo
exp(v: Float) =
todo