mirror of
https://github.com/carp-lang/Carp.git
synced 2024-08-15 16:20:40 +03:00
feat: Add Float.round (#1301)
Just a wrapper around the c std function.
This commit is contained in:
parent
c9967ddf6e
commit
d2dd875935
@ -14,6 +14,7 @@ suffixed with `f`.")
|
||||
(register to-bytes (Fn [Float] Int))
|
||||
(register from-int (Fn [Int] Float))
|
||||
(register copy (Fn [(Ref Float)] Float))
|
||||
(register round (Fn [Float] Int))
|
||||
|
||||
(register = (Fn [Float Float] Bool))
|
||||
(register < (Fn [Float Float] Bool))
|
||||
|
@ -130,3 +130,7 @@ float Float_floor(float x) {
|
||||
float Float_mod(float x, float y) {
|
||||
return fmodf(x, y);
|
||||
}
|
||||
|
||||
int Float_round(float x) {
|
||||
return roundf(x);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user