]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/d/dmd/root/ctfloat.h
2 /* Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved
3 * http://www.digitalmars.com
4 * Distributed under the Boost Software License, Version 1.0.
5 * http://www.boost.org/LICENSE_1_0.txt
6 * https://github.com/dlang/dmd/blob/master/src/dmd/root/ctfloat.h
11 #include "longdouble.h"
13 // Type used by the front-end for compile-time reals
14 typedef longdouble real_t
;
16 // Compile-time floating-point helper
19 static bool yl2x_supported
;
20 static bool yl2xp1_supported
;
22 static void yl2x(const real_t
*x
, const real_t
*y
, real_t
*res
);
23 static void yl2xp1(const real_t
*x
, const real_t
*y
, real_t
*res
);
25 static real_t
sin(real_t x
);
26 static real_t
cos(real_t x
);
27 static real_t
tan(real_t x
);
28 static real_t
sqrt(real_t x
);
29 static real_t
fabs(real_t x
);
30 static real_t
ldexp(real_t n
, int exp
);
32 static bool isIdentical(real_t a
, real_t b
);
33 static bool isNaN(real_t r
);
34 static bool isSNaN(real_t r
);
35 static bool isInfinity(real_t r
);
37 static real_t
parse(const char *literal
, bool *isOutOfRange
= NULL
);
38 static int sprint(char *str
, char fmt
, real_t x
);
40 static size_t hash(real_t a
);
42 // Constant real values 0, 1, -1 and 0.5.
45 static real_t minusone
;