math: avoid runtime conversions of floating-point constants
[musl] / src / complex / cacosf.c
index 2e04854..ed8acf0 100644 (file)
@@ -2,8 +2,10 @@
 
 // FIXME
 
+static const float float_pi_2 = M_PI_2;
+
 float complex cacosf(float complex z)
 {
        z = casinf(z);
-       return CMPLXF((float)M_PI_2 - crealf(z), -cimagf(z));
+       return CMPLXF(float_pi_2 - crealf(z), -cimagf(z));
 }