Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit e68ca24

Browse files
committed
WIP make const
1 parent d153151 commit e68ca24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/math/cbrtf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ pub extern "C" fn cbrtf(x: f32) -> f32 {
4545
/* rough cbrt to 5 bits */
4646
let mut t: f32 = if FLT_UWORD_IS_SUBNORMAL(hx) {
4747
/* subnormal number */
48-
let t: f32 = f32::from_bits(0x4b80_0000);
49-
let high: u32 = (x * t).to_bits(); /* x * (2 ** 24)*/
48+
const X1P24: f32 = 16777216f32; // 2 ** 24
49+
let high: u32 = (x * X1P24).to_bits();
5050
f32::from_bits((high / 3).wrapping_add(B2))
5151
} else {
5252
f32::from_bits((hx / 3).wrapping_add(B1))

0 commit comments

Comments
 (0)