Skip to content

Commit

Permalink
Add run math test
Browse files Browse the repository at this point in the history
  • Loading branch information
imaqtkatt committed Jul 4, 2024
1 parent 19dad2e commit e0642c2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/fun/builtins.bend
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,6 @@ String/encode_ascii (String/Nil) = (List/Nil)
# The Pi constant.
Math/PI = 3.1415926535

# The Euler's number.
Math/E = 2.717281728

# Math/sin(a: f24) -> f24
# Computes the sine of the given angle in radians.
hvm Math/sin:
Expand Down
18 changes: 18 additions & 0 deletions tests/golden_tests/run_file/math.bend
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
def main:
use rad = Math/radians
return [
Math/sin(rad(30.0)),
Math/cos(rad(30.0)),
Math/tan(rad(30.0)),

Math/cot(rad(30.0)),
Math/sec(rad(30.0)),
Math/csc(rad(30.0)),

rad(67.4),

Math/sqrt(9.0),

Math/ceil(9.75),
Math/floor(9.75),
]

0 comments on commit e0642c2

Please sign in to comment.