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

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