24.8 fixed to float64/double three ways

2023-01-17 Thread
In main.go are three ways to convert 24.8 fixed value to float64/double type. The 3d one is my way which is not efficient but is useful to illustrate how to convert 24.8 fixed value to float64/double type.程安絮package main import ( . "fmt" "unsaf

wl_fixed_to_double() function only correct when fixed value is greater than zero

2023-01-16 Thread
rstand how wl_fixed_to_double works, can anyone illustrate that for me? --------程安絮 package main /* double wl_fixed_to_double (unsigned int fix){ union di { double d; long i; }; union di u; u.i = ((1023L + 44L) << 52) + (1L << 51) + fix; return u.d - (3L