Added trigonometric functions to code gen and builtins

This commit is contained in:
Chad Stearns 2020-05-25 16:28:41 -04:00
parent c83a6dc7b8
commit 5c1c9efb89
6 changed files with 102 additions and 0 deletions

View file

@ -463,6 +463,24 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
unique_function(vec![float_type(UVAR1)], float_type(UVAR2)),
);
// sin : Float -> Float
add_type(
Symbol::FLOAT_SIN,
unique_function(vec![float_type(UVAR1)], float_type(UVAR2)),
);
// cos : Float -> Float
add_type(
Symbol::FLOAT_COS,
unique_function(vec![float_type(UVAR1)], float_type(UVAR2)),
);
// tan : Float -> Float
add_type(
Symbol::FLOAT_TAN,
unique_function(vec![float_type(UVAR1)], float_type(UVAR2)),
);
// highest : Float
add_type(Symbol::FLOAT_HIGHEST, float_type(UVAR1));