Implement global math functions #43
Labels
enhancement
Any addition to this project's existing capabilities
good first issue
A great place for newcomers to jump in! Usually doesn't involve a deep understanding of the project
help wanted
Any issue that's easily completed by someone without commit access
stdlib
Affects the standard library included with this BrightScript implementation
The BrightScript language supports 17 global math functions:
Abs(x as Float) as Float
Atn(x as Float) as Float
Cdbl(x as Integer) as Float
Cint(x as Float) as Integer
Cos(x as Float) as Float
Csng(x as Integer) as Float
Exp(x as Float) as Float
Fix(x as Float) as Integer
Int(x as Float) as Integer
Log(x as Float) as Float
Rnd(range as Integer) as Integer
Rnd(0) as Float
Sgn(x as Float) as Integer
Sgn(x as Integer) as Integer
Sin(x as Float) as Float
Sqr(x as Float) as Float
Tan(x as Float) as Float
We should get those implemented! Luckily they seem to all be wrappers around JavaScript's
Math
native functions, so these should be relatively easy to implement as native functions. Also luckily: they all operate on eitherFloat
orInt32
, so we shouldn't have to worry about dealing with 64-bit integer math!The text was updated successfully, but these errors were encountered: