diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-07-21 12:39:05 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-07-21 12:39:05 +0100 |
| commit | 6b3cf051f8f95cd6c3e71f95d579653335a2dd35 (patch) | |
| tree | 43e94b9a2cfb89efc4a03a19f8eff9d27fabd12b | |
| parent | 4ecd6e592b7ae87a0a03234a647398614d32d3e8 (diff) | |
Fix math.odin, again
| -rw-r--r-- | core/math.odin | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/math.odin b/core/math.odin index cd4e165af..9c338de77 100644 --- a/core/math.odin +++ b/core/math.odin @@ -78,11 +78,11 @@ copy_sign :: proc(x, y: f64) -> f64 { round :: proc(x: f32) -> f32 { if x >= 0 do return floor(x + 0.5); return ceil(x - 0.5); } round :: proc(x: f64) -> f64 { if x >= 0 do return floor(x + 0.5); return ceil(x - 0.5); } -floor :: proc(x: f32) -> f32 { if x >= 0 do f32(i64(x)); return f32(i64(x-0.5)); } // TODO: Get accurate versions -floor :: proc(x: f64) -> f64 { if x >= 0 do f64(i64(x)); return f64(i64(x-0.5)); } // TODO: Get accurate versions +floor :: proc(x: f32) -> f32 { if x >= 0 do return f32(i64(x)); return f32(i64(x-0.5)); } // TODO: Get accurate versions +floor :: proc(x: f64) -> f64 { if x >= 0 do return f64(i64(x)); return f64(i64(x-0.5)); } // TODO: Get accurate versions -ceil :: proc(x: f32) -> f32 { if x < 0 do f32(i64(x)); return f32(i64(x+1)); }// TODO: Get accurate versions -ceil :: proc(x: f64) -> f64 { if x < 0 do f64(i64(x)); return f64(i64(x+1)); }// TODO: Get accurate versions +ceil :: proc(x: f32) -> f32 { if x < 0 do return f32(i64(x)); return f32(i64(x+1)); }// TODO: Get accurate versions +ceil :: proc(x: f64) -> f64 { if x < 0 do return f64(i64(x)); return f64(i64(x+1)); }// TODO: Get accurate versions remainder :: proc(x, y: f32) -> f32 do return x - round(x/y) * y; remainder :: proc(x, y: f64) -> f64 do return x - round(x/y) * y; |