We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
math
1 parent d1ec41c commit 2b479b5Copy full SHA for 2b479b5
1 file changed
vlib/math/floor.v
@@ -84,15 +84,13 @@ pub fn round(x f64) f64 {
84
mut y := floor(x) // Fractional part
85
mut r := x - y // Round up to nearest.
86
if r > 0.5 {
87
- unsafe {
88
- goto rndup
89
- }
+ y += 1.0
+ return y
90
}
91
// Round to even
92
if r == 0.5 {
93
r = y - 2.0 * floor(0.5 * y)
94
if r == 1.0 {
95
- rndup:
96
y += 1.0
97
98
0 commit comments