[444] | 1 | /* @(#)s_exp10.c 5.1 93/09/24 */ |
---|
| 2 | /* Modified from s_exp2.c by Yaakov Selkowitz 2007. */ |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * ==================================================== |
---|
| 6 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. |
---|
| 7 | * |
---|
| 8 | * Developed at SunPro, a Sun Microsystems, Inc. business. |
---|
| 9 | * Permission to use, copy, modify, and distribute this |
---|
| 10 | * software is freely granted, provided that this notice |
---|
| 11 | * is preserved. |
---|
| 12 | * ==================================================== |
---|
| 13 | */ |
---|
| 14 | |
---|
| 15 | /* |
---|
| 16 | FUNCTION |
---|
| 17 | <<exp10>>, <<exp10f>>---exponential, base 10 |
---|
| 18 | INDEX |
---|
| 19 | exp10 |
---|
| 20 | INDEX |
---|
| 21 | exp10f |
---|
| 22 | |
---|
| 23 | SYNOPSIS |
---|
| 24 | #include <math.h> |
---|
| 25 | double exp10(double <[x]>); |
---|
| 26 | float exp10f(float <[x]>); |
---|
| 27 | |
---|
| 28 | DESCRIPTION |
---|
| 29 | <<exp10>> and <<exp10f>> calculate 10 ^ <[x]>, that is, |
---|
| 30 | @ifnottex |
---|
| 31 | 10 raised to the power <[x]>. |
---|
| 32 | @end ifnottex |
---|
| 33 | @tex |
---|
| 34 | $10^x$ |
---|
| 35 | @end tex |
---|
| 36 | |
---|
| 37 | You can use the (non-ANSI) function <<matherr>> to specify |
---|
| 38 | error handling for these functions. |
---|
| 39 | |
---|
| 40 | RETURNS |
---|
| 41 | On success, <<exp10>> and <<exp10f>> return the calculated value. |
---|
| 42 | If the result underflows, the returned value is <<0>>. If the |
---|
| 43 | result overflows, the returned value is <<HUGE_VAL>>. In |
---|
| 44 | either case, <<errno>> is set to <<ERANGE>>. |
---|
| 45 | |
---|
| 46 | PORTABILITY |
---|
| 47 | <<exp10>> and <<exp10f>> are GNU extensions. |
---|
| 48 | |
---|
| 49 | */ |
---|
| 50 | |
---|
| 51 | /* |
---|
| 52 | * wrapper exp10(x) |
---|
| 53 | */ |
---|
| 54 | |
---|
| 55 | #undef exp10 |
---|
| 56 | #include "fdlibm.h" |
---|
| 57 | #include <errno.h> |
---|
| 58 | #include <math.h> |
---|
| 59 | |
---|
| 60 | #ifndef _DOUBLE_IS_32BITS |
---|
| 61 | |
---|
| 62 | #ifdef __STDC__ |
---|
| 63 | double exp10(double x) /* wrapper exp10 */ |
---|
| 64 | #else |
---|
| 65 | double exp10(x) /* wrapper exp10 */ |
---|
| 66 | double x; |
---|
| 67 | #endif |
---|
| 68 | { |
---|
| 69 | return pow(10.0, x); |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | #endif /* defined(_DOUBLE_IS_32BITS) */ |
---|