Changeset 1831fd12 in rtems for testsuites/libtests/mathl/domathl.c
- Timestamp:
- 05/24/12 05:15:40 (11 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 2a7b823
- Parents:
- 87c8d8ab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuites/libtests/mathl/domathl.c
r87c8d8ab r1831fd12 12 12 13 13 #ifdef HAVE_CONFIG_H 14 #include "config.h"14 #include "config.h" 15 15 #endif 16 16 17 #include <math.h> 18 #include <stdio.h> 19 20 #ifndef M_PI_2 21 #define M_PI_2 1.57079632679489661923 17 #ifdef NO_LONG_DOUBLE 18 #define PROVIDE_EMPTY_FUNC 22 19 #endif 23 20 24 # ifndef M_PI_425 #define M_PI_4 0.7853981633974483096226 # endif21 #define SUFFIX l 22 #define FTYPE long double 23 #define PRI "%Lf" 27 24 28 extern void domathl (void); 29 30 void 31 domathl (void) 32 { 33 #ifndef NO_LONG_DOUBLE 34 long double f1; 35 long double f2; 36 37 int i1; 38 39 f1 = acosl(0.0); 40 fprintf( stdout, "acosl : %Lf\n", f1); 41 42 f1 = acoshl(0.0); 43 fprintf( stdout, "acoshl : %Lf\n", f1); 44 45 f1 = asinl(1.0); 46 fprintf( stdout, "asinl : %Lf\n", f1); 47 48 f1 = asinhl(1.0); 49 fprintf( stdout, "asinhl : %Lf\n", f1); 50 51 f1 = atanl(M_PI_4); 52 fprintf( stdout, "atanl : %Lf\n", f1); 53 54 f1 = atan2l(2.3, 2.3); 55 fprintf( stdout, "atan2l : %Lf\n", f1); 56 57 f1 = atanhl(1.0); 58 fprintf( stdout, "atanhl : %Lf\n", f1); 59 60 f1 = cbrtl(27.0); 61 fprintf( stdout, "cbrtl : %Lf\n", f1); 62 63 f1 = ceill(3.5); 64 fprintf( stdout, "ceill : %Lf\n", f1); 65 66 f1 = copysignl(3.5, -2.5); 67 fprintf( stdout, "copysignl : %Lf\n", f1); 68 69 f1 = cosl(M_PI_2); 70 fprintf( stdout, "cosl : %Lf\n", f1); 71 72 f1 = coshl(M_PI_2); 73 fprintf( stdout, "coshl : %Lf\n", f1); 74 75 f1 = erfl(42.0); 76 fprintf( stdout, "erfl : %Lf\n", f1); 77 78 f1 = erfcl(42.0); 79 fprintf( stdout, "erfcl : %Lf\n", f1); 80 81 f1 = expl(0.42); 82 fprintf( stdout, "expl : %Lf\n", f1); 83 84 f1 = exp2l(0.42); 85 fprintf( stdout, "exp2l : %Lf\n", f1); 86 87 f1 = expm1l(0.00042); 88 fprintf( stdout, "expm1l : %Lf\n", f1); 89 90 f1 = fabsl(-1.123); 91 fprintf( stdout, "fabsl : %Lf\n", f1); 92 93 f1 = fdiml(1.123, 2.123); 94 fprintf( stdout, "fdiml : %Lf\n", f1); 95 96 f1 = floorl(0.5); 97 fprintf( stdout, "floorl : %Lf\n", f1); 98 f1 = floorl(-0.5); 99 fprintf( stdout, "floorl : %Lf\n", f1); 100 101 f1 = fmal(2.1, 2.2, 3.01); 102 fprintf( stdout, "fmal : %Lf\n", f1); 103 104 f1 = fmaxl(-0.42, 0.42); 105 fprintf( stdout, "fmaxl : %Lf\n", f1); 106 107 f1 = fminl(-0.42, 0.42); 108 fprintf( stdout, "fminl : %Lf\n", f1); 109 110 f1 = fmodl(42.0, 3.0); 111 fprintf( stdout, "fmodl : %Lf\n", f1); 112 113 /* no type-specific variant */ 114 i1 = fpclassify(1.0); 115 fprintf( stdout, "fpclassify : %d\n", i1); 116 117 f1 = frexpl(42.0, &i1); 118 fprintf( stdout, "frexpl : %Lf\n", f1); 119 120 f1 = hypotl(42.0, 42.0); 121 fprintf( stdout, "hypotl : %Lf\n", f1); 122 123 i1 = ilogbl(42.0); 124 fprintf( stdout, "ilogbl : %d\n", i1); 125 126 /* no type-specific variant */ 127 i1 = isfinite(3.0); 128 fprintf( stdout, "isfinite : %d\n", i1); 129 130 /* no type-specific variant */ 131 i1 = isgreater(3.0, 3.1); 132 fprintf( stdout, "isgreater : %d\n", i1); 133 134 /* no type-specific variant */ 135 i1 = isgreaterequal(3.0, 3.1); 136 fprintf( stdout, "isgreaterequal : %d\n", i1); 137 138 /* no type-specific variant */ 139 i1 = isinf(3.0); 140 fprintf( stdout, "isinf : %d\n", i1); 141 142 /* no type-specific variant */ 143 i1 = isless(3.0, 3.1); 144 fprintf( stdout, "isless : %d\n", i1); 145 146 /* no type-specific variant */ 147 i1 = islessequal(3.0, 3.1); 148 fprintf( stdout, "islessequal : %d\n", i1); 149 150 /* no type-specific variant */ 151 i1 = islessgreater(3.0, 3.1); 152 fprintf( stdout, "islessgreater : %d\n", i1); 153 154 /* no type-specific variant */ 155 i1 = isnan(0.0); 156 fprintf( stdout, "isnan : %d\n", i1); 157 158 /* no type-specific variant */ 159 i1 = isnormal(3.0); 160 fprintf( stdout, "isnormal : %d\n", i1); 161 162 /* no type-specific variant */ 163 f1 = isunordered(1.0, 2.0); 164 fprintf( stdout, "isunordered : %d\n", i1); 165 166 f1 = j0l(1.2); 167 fprintf( stdout, "j0l : %Lf\n", f1); 168 169 f1 = j1l(1.2); 170 fprintf( stdout, "j1l : %Lf\n", f1); 171 172 f1 = jnl(2,1.2); 173 fprintf( stdout, "jnl : %Lf\n", f1); 174 175 f1 = ldexpl(1.2,3); 176 fprintf( stdout, "ldexpl : %Lf\n", f1); 177 178 f1 = lgammal(42.0); 179 fprintf( stdout, "lgammal : %Lf\n", f1); 180 181 f1 = llrintl(-0.5); 182 fprintf( stdout, "llrintl : %Lf\n", f1); 183 f1 = llrintl(0.5); 184 fprintf( stdout, "llrintl : %Lf\n", f1); 185 186 f1 = llroundl(-0.5); 187 fprintf( stdout, "lroundl : %Lf\n", f1); 188 f1 = llroundl(0.5); 189 fprintf( stdout, "lroundl : %Lf\n", f1); 190 191 f1 = logl(42.0); 192 fprintf( stdout, "logl : %Lf\n", f1); 193 194 f1 = log10l(42.0); 195 fprintf( stdout, "log10l : %Lf\n", f1); 196 197 f1 = log1pl(42.0); 198 fprintf( stdout, "log1pl : %Lf\n", f1); 199 200 f1 = log2l(42.0); 201 fprintf( stdout, "log2l : %Lf\n", f1); 202 203 f1 = logbl(42.0); 204 fprintf( stdout, "logbl : %Lf\n", f1); 205 206 f1 = lrintl(-0.5); 207 fprintf( stdout, "lrintl : %Lf\n", f1); 208 f1 = lrintl(0.5); 209 fprintf( stdout, "lrintl : %Lf\n", f1); 210 211 f1 = lroundl(-0.5); 212 fprintf( stdout, "lroundl : %Lf\n", f1); 213 f1 = lroundl(0.5); 214 fprintf( stdout, "lroundl : %Lf\n", f1); 215 216 f1 = modfl(42.0,&f2); 217 fprintf( stdout, "lmodfl : %Lf\n", f1); 218 219 f1 = nanl(""); 220 fprintf( stdout, "nanl : %Lf\n", f1); 221 222 f1 = nearbyintl(1.5); 223 fprintf( stdout, "nearbyintl : %Lf\n", f1); 224 225 f1 = nextafterl(1.5,2.0); 226 fprintf( stdout, "nextafterl : %Lf\n", f1); 227 228 f1 = powl(3.01, 2.0); 229 fprintf( stdout, "powl : %Lf\n", f1); 230 231 f1 = remainderl(3.01,2.0); 232 fprintf( stdout, "remainderl : %Lf\n", f1); 233 234 f1 = remquol(29.0,3.0,&i1); 235 fprintf( stdout, "remquol : %Lf\n", f1); 236 237 f1 = rintl(0.5); 238 fprintf( stdout, "rintl : %Lf\n", f1); 239 f1 = rintl(-0.5); 240 fprintf( stdout, "rintl : %Lf\n", f1); 241 242 f1 = roundl(0.5); 243 fprintf( stdout, "roundl : %Lf\n", f1); 244 f1 = roundl(-0.5); 245 fprintf( stdout, "roundl : %Lf\n", f1); 246 247 f1 = scalblnl(1.2,3); 248 fprintf( stdout, "scalblnl : %Lf\n", f1); 249 250 f1 = scalbnl(1.2,3); 251 fprintf( stdout, "scalbnl : %Lf\n", f1); 252 253 /* no type-specific variant */ 254 i1 = signbit(1.0); 255 fprintf( stdout, "signbit : %i\n", i1); 256 257 f1 = sinl(M_PI_4); 258 fprintf( stdout, "sinl : %Lf\n", f1); 259 260 f1 = sinhl(M_PI_4); 261 fprintf( stdout, "sinhl : %Lf\n", f1); 262 263 f1 = sqrtl(9.0); 264 fprintf( stdout, "sqrtl : %Lf\n", f1); 265 266 f1 = tanl(M_PI_4); 267 fprintf( stdout, "tanl : %Lf\n", f1); 268 269 f1 = tanhl(M_PI_4); 270 fprintf( stdout, "tanhl : %Lf\n", f1); 271 272 f1 = tgammal(2.1); 273 fprintf( stdout, "tgammal : %Lf\n", f1); 274 275 f1 = truncl(3.5); 276 fprintf( stdout, "truncl : %Lf\n", f1); 277 278 f1 = y0l(1.2); 279 fprintf( stdout, "y0l : %Lf\n", f1); 280 281 f1 = y1l(1.2); 282 fprintf( stdout, "y1l : %Lf\n", f1); 283 284 f1 = ynl(3,1.2); 285 fprintf( stdout, "ynl : %Lf\n", f1); 286 #endif 287 } 25 #include <domath.h>
Note: See TracChangeset
for help on using the changeset viewer.