mirror of
https://github.com/fluencelabs/musl
synced 2025-06-30 07:02:41 +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:
@ -15,7 +15,7 @@
|
||||
|
||||
#include "libm.h"
|
||||
|
||||
static const float one = 1.0, huge = 1.0e37;
|
||||
static const float huge = 1.0e37;
|
||||
|
||||
float sinhf(float x)
|
||||
{
|
||||
@ -36,12 +36,12 @@ float sinhf(float x)
|
||||
if (ix < 0x41100000) { /* |x|<9 */
|
||||
if (ix < 0x39800000) /* |x|<2**-12 */
|
||||
/* raise inexact, return x */
|
||||
if (huge+x > one)
|
||||
if (huge+x > 1.0f)
|
||||
return x;
|
||||
t = expm1f(fabsf(x));
|
||||
if (ix < 0x3f800000)
|
||||
return h*(2.0f*t - t*t/(t+one));
|
||||
return h*(t + t/(t+one));
|
||||
return h*(2.0f*t - t*t/(t+1.0f));
|
||||
return h*(t + t/(t+1.0f));
|
||||
}
|
||||
|
||||
/* |x| in [9, logf(maxfloat)] return 0.5*exp(|x|) */
|
||||
|
Reference in New Issue
Block a user