mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Add intrinsics for sqrt and round
This commit is contained in:
parent
0191910715
commit
b43e582c7a
4 changed files with 97 additions and 3 deletions
|
@ -323,6 +323,12 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
SolvedType::Func(vec![float_type()], Box::new(float_type())),
|
||||
);
|
||||
|
||||
// round : Float -> Int
|
||||
add_type(
|
||||
Symbol::FLOAT_ROUND,
|
||||
SolvedType::Func(vec![float_type()], Box::new(int_type())),
|
||||
);
|
||||
|
||||
// highest : Float
|
||||
add_type(Symbol::FLOAT_HIGHEST, float_type());
|
||||
|
||||
|
|
|
@ -386,6 +386,12 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
unique_function(vec![float_type(UVAR1)], float_type(UVAR2)),
|
||||
);
|
||||
|
||||
// round : Float -> Int
|
||||
add_type(
|
||||
Symbol::FLOAT_ROUND,
|
||||
unique_function(vec![float_type(UVAR1)], int_type(UVAR2)),
|
||||
);
|
||||
|
||||
// highest : Float
|
||||
add_type(Symbol::FLOAT_HIGHEST, float_type(UVAR1));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue