source: azure_iot_hub/trunk/musl-1.1.18/src/math/exp10f.c@ 389

Last change on this file since 389 was 389, checked in by coas-nagasima, 5 years ago

ビルドが通るよう更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc;charset=UTF-8
File size: 579 bytes
Line 
1#define _GNU_SOURCE
2#include <math.h>
3#include <stdint.h>
4#include "libc.h"
5
6float exp10f(float x)
7{
8 static const float p10[] = {
9 1e-7f, 1e-6f, 1e-5f, 1e-4f, 1e-3f, 1e-2f, 1e-1f,
10 1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7
11 };
12 float n, y = modff(x, &n);
13 union {float f; uint32_t i;} u = {n};
14 /* fabsf(n) < 8 without raising invalid on nan */
15 if ((u.i>>23 & 0xff) < 0x7f+3) {
16 if (!y) return p10[(int)n+7];
17 y = exp2f(3.32192809488736234787031942948939f * y);
18 return y * p10[(int)n+7];
19 }
20 return exp2(3.32192809488736234787031942948939 * x);
21}
22
23weak_alias(exp10f, pow10f);
Note: See TracBrowser for help on using the repository browser.