| * This file has no copyright assigned and is placed in the Public Domain. |
| * This file is part of the mingw-w64 runtime package. |
| * No warranty is given; refer to the file DISCLAIMER.PD within this package. |
| typedef union ieee754_double_ { |
| struct __attribute__((__packed__)) { |
| typedef union ieee754_float_ { |
| struct __attribute__((__packed__)) { |
| ieee754_double u = { .f = x }; |
| if (u.sgn == 0 && u.f52 == 0 && u.exp > 0 && u.exp < 0x7ff) { |
| // Handle exact powers of two exactly |
| return (int)u.exp - 1023; |
| return log(x) / 0.69314718246459960938; |
| ieee754_float u = { .f = x }; |
| if (u.sgn == 0 && u.f23 == 0 && u.exp > 0 && u.exp < 0xff) { |
| // Handle exact powers of two exactly |
| return logf(x) / 0.69314718246459960938f; |
| long double log2l(long double x) |