diff --git a/lib/math/floats.ww b/lib/math/floats.ww index d6bd2367..cb9ce8ff 100644 --- a/lib/math/floats.ww +++ b/lib/math/floats.ww @@ -6,17 +6,17 @@ package math; // Returns the binary representation of the given f64. -// ref/hare/math/floats.ha:5 +// ref/hare/math/floats.ha:5. Parens around &n are load-bearing: ww's `:` +// cast binds tighter than unary `&`, so Hare's `*(&n: *u64)` would parse +// as `*(&(n: *u64))`; `(&n): *u64` reinterprets the address as intended. export fn f64bits(n: f64) u64 = { - let p: *u64 = (&n): *u64; - return *p; + return *((&n): *u64); }; // Returns f64 with the given binary representation. // ref/hare/math/floats.ha:11 export fn f64frombits(n: u64) f64 = { - let p: *f64 = (&n): *f64; - return *p; + return *((&n): *f64); }; // ref/hare/math/floats.ha:17,20,23 declare these as untyped int. ww has