mirror of
https://github.com/fluencelabs/musl
synced 2025-06-25 12:42:02 +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:
@ -78,7 +78,7 @@
|
||||
|
||||
#include "libm.h"
|
||||
|
||||
static const double one = 1.0, tiny = 1.0e-300;
|
||||
static const double tiny = 1.0e-300;
|
||||
|
||||
double sqrt(double x)
|
||||
{
|
||||
@ -161,13 +161,13 @@ double sqrt(double x)
|
||||
|
||||
/* use floating add to find out rounding direction */
|
||||
if ((ix0|ix1) != 0) {
|
||||
z = one - tiny; /* raise inexact flag */
|
||||
if (z >= one) {
|
||||
z = one + tiny;
|
||||
z = 1.0 - tiny; /* raise inexact flag */
|
||||
if (z >= 1.0) {
|
||||
z = 1.0 + tiny;
|
||||
if (q1 == (uint32_t)0xffffffff) {
|
||||
q1 = 0;
|
||||
q++;
|
||||
} else if (z > one) {
|
||||
} else if (z > 1.0) {
|
||||
if (q1 == (uint32_t)0xfffffffe)
|
||||
q++;
|
||||
q1 += 2;
|
||||
|
Reference in New Issue
Block a user