Ticket #627: tango-posix-math.patch
| File tango-posix-math.patch, 2.9 kB (added by afb, 1 year ago) |
|---|
tango-posix-math.patch |
-
tango/stdc/math.d
old new 168 168 } 169 169 } 170 170 } 171 else version( Posix )171 else version( linux ) 172 172 { 173 173 enum 174 174 { … … 264 264 } 265 265 } 266 266 } 267 else version( darwin ) 268 { 269 enum 270 { 271 FP_NAN = 1, 272 FP_INFINITE = 2, 273 FP_ZERO = 3, 274 FP_NORMAL = 4, 275 FP_SUBNORMAL = 5, 276 FP_SUPERNORMAL = 6, 277 } 267 278 279 enum 280 { 281 FP_FAST_FMA = 0, 282 FP_FAST_FMAF = 0, 283 FP_FAST_FMAL = 0, 284 } 285 286 int __fpclassifyf(float x); 287 int __fpclassifyd(double x); 288 int __fpclassify(real x); 289 290 int __isfinitef(float x); 291 int __isfinited(double x); 292 int __isfinite(real x); 293 294 int __isinff(float x); 295 int __isinfd(double x); 296 int __isinf(real x); 297 298 int __isnanf(float x); 299 int __isnand(double x); 300 int __isnan(real x); 301 302 int __signbitf(float x); 303 int __signbitd(double x); 304 int __signbitl(real x); // <-- always one exception to every rule 305 306 extern (D) 307 { 308 //int fpclassify(real-floating x); 309 int fpclassify(float x) { return __fpclassifyf(x); } 310 int fpclassify(double x) { return __fpclassifyd(x); } 311 int fpclassify(real x) 312 { 313 return (real.sizeof == double.sizeof) 314 ? __fpclassifyd(x) 315 : __fpclassify(x); 316 } 317 318 //int isfinite(real-floating x); 319 int isfinite(float x) { return __isfinitef(x); } 320 int isfinite(double x) { return __isfinited(x); } 321 int isfinite(real x) 322 { 323 return (real.sizeof == double.sizeof) 324 ? __isfinited(x) 325 : __isfinite(x); 326 } 327 328 //int isinf(real-floating x); 329 int isinf(float x) { return __isinff(x); } 330 int isinf(double x) { return __isinfd(x); } 331 int isinf(real x) 332 { 333 return (real.sizeof == double.sizeof) 334 ? __isinfd(x) 335 : __isinf(x); 336 } 337 338 //int isnan(real-floating x); 339 int isnan(float x) { return __isnanf(x); } 340 int isnan(double x) { return __isnand(x); } 341 int isnan(real x) 342 { 343 return (real.sizeof == double.sizeof) 344 ? __isnand(x) 345 : __isnan(x); 346 } 347 348 //int isnormal(real-floating x); 349 int isnormal(float x) { return fpclassify(x) == FP_NORMAL; } 350 int isnormal(double x) { return fpclassify(x) == FP_NORMAL; } 351 int isnormal(real x) { return fpclassify(x) == FP_NORMAL; } 352 353 //int signbit(real-floating x); 354 int signbit(float x) { return __signbitf(x); } 355 int signbit(double x) { return __signbitd(x); } 356 int signbit(real x) 357 { 358 return (real.sizeof == double.sizeof) 359 ? __signbitd(x) 360 : __signbitl(x); 361 } 362 } 363 } 364 else static assert(0); 365 268 366 extern (D) 269 367 { 270 368 //int isgreater(real-floating x, real-floating y);










