]> www.ginac.de Git - cln.git/blob - src/float/transcendental/cl_F_roundpi.cc
Replace unused macro with cl_unused.
[cln.git] / src / float / transcendental / cl_F_roundpi.cc
1 // cl_round_pi().
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "float/transcendental/cl_F_tran.h"
8
9
10 // Implementation.
11
12 namespace cln {
13
14 const cl_F_div_t cl_round_pi (const cl_F& x)
15 {
16         if (float_exponent(x) <= 0)
17                 // Exponent <=0 -> |x|<1 -> |x/pi| < 1/2, also Division unnötig
18                 return cl_F_div_t(0,x); // Quotient 0, Rest x
19         else
20                 // x durch pi (mit hinreichender Genauigkeit) dividieren
21                 return round2(x,pi(x));
22 }
23
24 }  // namespace cln