repo.or.cz
/
newlib-cygwin.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git]
/
newlib
/
libc
/
stdlib
/
__exp10.c
blob
cf223742b4a7cb833c1cacd428ae45a6eddca9cc
1
/*
2
* compute 10**x by successive squaring.
3
*/
4
5
#include <_ansi.h>
6
#include
"std.h"
7
8
double
9
__exp10
(
unsigned
x
)
10
{
11
static const double
powtab
[] =
12
{
1.0
,
13
10.0
,
14
100.0
,
15
1000.0
,
16
10000.0
};
17
18
if
(
x
< (
sizeof
(
powtab
) /
sizeof
(
double
)))
19
return
powtab
[
x
];
20
else if
(
x
&
1
)
21
{
22
return
10.0
*
__exp10
(
x
-
1
);
23
}
24
else
25
{
26
double
n
=
__exp10
(
x
/
2
);
27
return
n
*
n
;
28
}
29
}