Skip to content

Commit

Permalink
std/math: update outdated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Jan 18, 2025
1 parent f1fe418 commit 355c9ca
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions std/math/floor.jule
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ fn Trunc(x: f64): f64 {
// Round(±Inf) = ±Inf
// Round(NaN) = NaN
fn Round(x: f64): f64 {
// round is a faster implementation of:
// Round is a faster implementation of:
//
// round(x f64) f64 {
// t: = trunc(x)
// if abs(x-t) >= 0.5 {
// ret t + copysign(1, x)
// }
// ret t
// }
// Round(x f64) f64 {
// t: = Trunc(x)
// if Abs(x-t) >= 0.5 {
// ret t + Copysign(1, x)
// }
// ret t
// }
mut bits := F64Bits(x)
mut e := uint(bits>>shift) & mask
if e < bias {
Expand Down Expand Up @@ -122,17 +122,17 @@ fn Round(x: f64): f64 {
// RoundEven(±Inf) = ±Inf
// RoundEven(NaN) = NaN
fn RoundEven(x: f64): f64 {
// round_even is a faster implementation of:
// RoundEven is a faster implementation of:
//
// round_even(x f64) f64 {
// t: = trunc(x)
// odd: = remainder(t, 2) != 0
// d: = abs(x - t)
// if d > 0.5 || (d == 0.5 && odd) {
// ret t + copysign(1, x)
// }
// ret t
// }
// RoundEven(x f64) f64 {
// t: = Trunc(x)
// odd: = Remainder(t, 2) != 0
// d: = Abs(x - t)
// if d > 0.5 || (d == 0.5 && odd) {
// ret t + Copysign(1, x)
// }
// ret t
// }
mut bits := F64Bits(x)
mut e := uint(bits>>shift) & mask
if e >= bias {
Expand Down

0 comments on commit 355c9ca

Please sign in to comment.