feat: Add Float.round (#1301)

Just a wrapper around the c std function.
This commit is contained in:
Scott Olsen 2021-08-23 14:31:29 -04:00 committed by GitHub
parent c9967ddf6e
commit d2dd875935
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -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))

View File

@ -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);
}