fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 248: Construct a 64-bit floating-point value
Idiom # 248: Construct a 64-bit floating-point value
See
programming-idioms.org
:
Code
NYI: this might become a library function in the future, see
#3248
d := (if s then -1.0 else 1.0) * m * (2.0 ** e.as_f64)
What are effects?
Running Example
ex248 is test_vals := [(false, 1.0 , (u32 10)), (false, 13.0 , (u32 7 )), (true , 17.0 , (u32 5 )), (true , 42.0 , (u32 8 )), (true , 0.66 , (u32 7 )), (false, 100.99, (u32 12))] for t in test_vals do (s,m,e) := t d := (if s then -1.0 else 1.0) * m * (2.0 ** e.as_f64) say "s=$s m=$m e=$e : $d"
What are effects?
last changed: 2024-07-01
next: Idiom # 249: Declare and assign multiple variables