numeric.fixed.internal


template <auto F1, auto F2>
inline uint<(1 + F2)> rcp_lookup(uint<F1> fraction) §

Input a value in the range [1, 2) without the implicit leading one. Output a value in the range ~(0.5, 1] with one integral bit.

template <auto F1, auto F2, auto F3>
inline 
uint<(1 + F3)>
rcp_refine(uint<(1 + F1)> significand, uint<(1 + F2)> approximation) §

Newton-Raphson method. Input a significand in the range [1, 2) and an approximation in the range ~(0.5, 1]. Output a value in the range ~(0.5, 1].

template <auto F1, auto F2>
inline int<(2 + F2)> sin_pirad(uint<(1 + F1)> value) §

Input a value in the range [0, 2) in multiple of pi radian. Output the sine in the range [-1, 1].

template <auto F1, auto F2>
inline int<(2 + F2)> cos_pirad(uint<(1 + F1)> value) §

Input a value in the range [0, 2) in multiple of pi radian. Output the cosine in the range [-1, 1].