mirror of
https://github.com/fluencelabs/musl
synced 2025-06-24 12:12:04 +00:00
code cleanup of named constants
zero, one, two, half are replaced by const literals The policy was to use the f suffix for float consts (1.0f), but don't use suffix for long double consts (these consts can be exactly represented as double).
This commit is contained in:
@ -27,7 +27,6 @@
|
||||
#include "libm.h"
|
||||
|
||||
static const double
|
||||
one = 1.0,
|
||||
ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */
|
||||
|
||||
double acosh(double x)
|
||||
@ -47,9 +46,9 @@ double acosh(double x)
|
||||
return 0.0; /* acosh(1) = 0 */
|
||||
} else if (hx > 0x40000000) { /* 2**28 > x > 2 */
|
||||
t = x*x;
|
||||
return log(2.0*x - one/(x+sqrt(t-one)));
|
||||
return log(2.0*x - 1.0/(x+sqrt(t-1.0)));
|
||||
} else { /* 1 < x < 2 */
|
||||
t = x-one;
|
||||
t = x-1.0;
|
||||
return log1p(t + sqrt(2.0*t+t*t));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user