Debian Codegraph @

libphobos/libdruntime/core/stdc/math.d

raw
1 /**
2 * D header file for C99.
3 *
4 * $(C_HEADER_DESCRIPTION pubs.opengroup.org/onlinepubs/009695399/basedefs/_math.h.html, _math.h)
5 *
6 * Copyright: Copyright Sean Kelly 2005 - 2012.
7 * License: Distributed under the
8 * $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
9 * (See accompanying file LICENSE)
10 * Authors: Sean Kelly
11 * Source: $(DRUNTIMESRC core/stdc/_math.d)
12 */
13
14 module core.stdc.math;
15
16 import core.stdc.config;
17
18 version (OSX)
19 version = Darwin;
20 else version (iOS)
21 version = Darwin;
22 else version (TVOS)
23 version = Darwin;
24 else version (WatchOS)
25 version = Darwin;
26
27 version (ARM) version = ARM_Any;
28 version (AArch64) version = ARM_Any;
29 version (HPPA) version = HPPA_Any;
30 version (MIPS32) version = MIPS_Any;
31 version (MIPS64) version = MIPS_Any;
32 version (PPC) version = PPC_Any;
33 version (PPC64) version = PPC_Any;
34 version (RISCV32) version = RISCV_Any;
35 version (RISCV64) version = RISCV_Any;
36 version (S390) version = IBMZ_Any;
37 version (SPARC) version = SPARC_Any;
38 version (SPARC64) version = SPARC_Any;
39 version (SystemZ) version = IBMZ_Any;
40 version (X86) version = X86_Any;
41 version (X86_64) version = X86_Any;
42
43 extern (C):
44 @trusted: // All functions here operate on floating point and integer values only.
45 nothrow:
46 @nogc:
47
48 ///
49 alias float float_t;
50 ///
51 alias double double_t;
52
53 ///
54 enum double HUGE_VAL = double.infinity;
55 ///
56 enum double HUGE_VALF = float.infinity;
57 ///
58 enum double HUGE_VALL = real.infinity;
59
60 ///
61 enum float INFINITY = float.infinity;
62 ///
63 enum float NAN = float.nan;
64
65 version (FreeBSD)
66 {
67 ///
68 enum int FP_ILOGB0 = -int.max;
69 ///
70 enum int FP_ILOGBNAN = int.max;
71 }
72 else version (NetBSD)
73 {
74 ///
75 enum int FP_ILOGB0 = -int.max;
76 ///
77 enum int FP_ILOGBNAN = int.max;
78 }
79 else version (OpenBSD)
80 {
81 ///
82 enum int FP_ILOGB0 = -int.max;
83 ///
84 enum int FP_ILOGBNAN = int.max;
85 }
86 else version (DragonFlyBSD)
87 {
88 ///
89 enum int FP_ILOGB0 = -int.max;
90 ///
91 enum int FP_ILOGBNAN = int.max;
92 }
93 else version (Solaris)
94 {
95 ///
96 enum int FP_ILOGB0 = -int.max;
97 ///
98 enum int FP_ILOGBNAN = int.max;
99 }
100 else version (CRuntime_Bionic)
101 {
102 ///
103 enum int FP_ILOGB0 = -int.max;
104 ///
105 enum int FP_ILOGBNAN = int.max;
106 }
107 else version (CRuntime_UClibc)
108 {
109 version (X86_Any)
110 {
111 ///
112 enum int FP_ILOGB0 = int.min;
113 ///
114 enum int FP_ILOGBNAN = int.min;
115 }
116 else version (MIPS_Any)
117 {
118 ///
119 enum int FP_ILOGB0 = -int.max;
120 ///
121 enum int FP_ILOGBNAN = int.max;
122 }
123 else version (ARM)
124 {
125 ///
126 enum int FP_ILOGB0 = -int.max;
127 ///
128 enum int FP_ILOGBNAN = int.max;
129 }
130 else
131 {
132 static assert(false, "Architecture not supported.");
133 }
134 }
135 else version (CRuntime_Glibc)
136 {
137 version (X86_Any)
138 {
139 ///
140 enum int FP_ILOGB0 = int.min;
141 ///
142 enum int FP_ILOGBNAN = int.min;
143 }
144 else version (ARM_Any)
145 {
146 ///
147 enum int FP_ILOGB0 = -int.max;
148 ///
149 enum int FP_ILOGBNAN = int.max;
150 }
151 else version (HPPA_Any)
152 {
153 ///
154 enum int FP_ILOGB0 = -int.max;
155 ///
156 enum int FP_ILOGBNAN = int.max;
157 }
158 else version (MIPS_Any)
159 {
160 ///
161 enum int FP_ILOGB0 = -int.max;
162 ///
163 enum int FP_ILOGBNAN = int.max;
164 }
165 else version (PPC_Any)
166 {
167 ///
168 enum int FP_ILOGB0 = -int.max;
169 ///
170 enum int FP_ILOGBNAN = int.max;
171 }
172 else version (RISCV_Any)
173 {
174 ///
175 enum int FP_ILOGB0 = -int.max;
176 ///
177 enum int FP_ILOGBNAN = int.max;
178 }
179 else version (SPARC_Any)
180 {
181 ///
182 enum int FP_ILOGB0 = -int.max;
183 ///
184 enum int FP_ILOGBNAN = int.max;
185 }
186 else version (IBMZ_Any)
187 {
188 ///
189 enum int FP_ILOGB0 = -int.max;
190 ///
191 enum int FP_ILOGBNAN = int.max;
192 }
193 else version (LoongArch64)
194 {
195 ///
196 enum int FP_ILOGB0 = -int.max;
197 ///
198 enum int FP_ILOGBNAN = int.max;
199 }
200 else
201 {
202 static assert(false, "Architecture not supported.");
203 }
204 }
205 else
206 {
207 ///
208 enum int FP_ILOGB0 = int.min;
209 ///
210 enum int FP_ILOGBNAN = int.min;
211 }
212
213 ///
214 enum int MATH_ERRNO = 1;
215 ///
216 enum int MATH_ERREXCEPT = 2;
217 ///
218 enum int math_errhandling = MATH_ERRNO | MATH_ERREXCEPT;
219
220 version (none)
221 {
222 //
223 // these functions are all macros in C
224 //
225
226 //int fpclassify(real-floating x);
227 pure int fpclassify(float x);
228 pure int fpclassify(double x);
229 pure int fpclassify(real x);
230
231 //int isfinite(real-floating x);
232 pure int isfinite(float x);
233 pure int isfinite(double x);
234 pure int isfinite(real x);
235
236 //int isinf(real-floating x);
237 pure int isinf(float x);
238 pure int isinf(double x);
239 pure int isinf(real x);
240
241 //int isnan(real-floating x);
242 pure int isnan(float x);
243 pure int isnan(double x);
244 pure int isnan(real x);
245
246 //int isnormal(real-floating x);
247 pure int isnormal(float x);
248 pure int isnormal(double x);
249 pure int isnormal(real x);
250
251 //int signbit(real-floating x);
252 pure int signbit(float x);
253 pure int signbit(double x);
254 pure int signbit(real x);
255
256 //int isgreater(real-floating x, real-floating y);
257 pure int isgreater(float x, float y);
258 pure int isgreater(double x, double y);
259 pure int isgreater(real x, real y);
260
261 //int isgreaterequal(real-floating x, real-floating y);
262 pure int isgreaterequal(float x, float y);
263 pure int isgreaterequal(double x, double y);
264 pure int isgreaterequal(real x, real y);
265
266 //int isless(real-floating x, real-floating y);
267 pure int isless(float x, float y);
268 pure int isless(double x, double y);
269 pure int isless(real x, real y);
270
271 //int islessequal(real-floating x, real-floating y);
272 pure int islessequal(float x, float y);
273 pure int islessequal(double x, double y);
274 pure int islessequal(real x, real y);
275
276 //int islessgreater(real-floating x, real-floating y);
277 pure int islessgreater(float x, float y);
278 pure int islessgreater(double x, double y);
279 pure int islessgreater(real x, real y);
280
281 //int isunordered(real-floating x, real-floating y);
282 pure int isunordered(float x, float y);
283 pure int isunordered(double x, double y);
284 pure int isunordered(real x, real y);
285 }
286
287 version (CRuntime_Microsoft) // fully supported since MSVCRT 12 (VS 2013) only
288 {
289 version (all) // legacy stuff to be removed in the future
290 {
291 enum
292 {
293 _FPCLASS_SNAN = 1,
294 _FPCLASS_QNAN = 2,
295 _FPCLASS_NINF = 4,
296 _FPCLASS_NN = 8,
297 _FPCLASS_ND = 0x10,
298 _FPCLASS_NZ = 0x20,
299 _FPCLASS_PZ = 0x40,
300 _FPCLASS_PD = 0x80,
301 _FPCLASS_PN = 0x100,
302 _FPCLASS_PINF = 0x200,
303 }
304
305 //deprecated("Please use the standard C99 function copysignf() instead.")
306 pure float _copysignf(float x, float s);
307
308 //deprecated("_chgsignf(x) is a non-standard MS extension. Please consider using -x instead.")
309 pure float _chgsignf(float x);
310
311 version (Win64) // not available in 32-bit runtimes
312 {
313 //deprecated("Please use the standard C99 function isfinite() instead.")
314 pure int _finitef(float x);
315
316 //deprecated("Please use the standard C99 function isnan() instead.")
317 pure int _isnanf(float x);
318
319 //deprecated("Please use the standard C99 function fpclassify() instead.")
320 pure int _fpclassf(float x);
321 }
322
323 //deprecated("Please use the standard C99 function copysign() instead.")
324 pure double _copysign(double x, double s);
325
326 //deprecated("_chgsign(x) is a non-standard MS extension. Please consider using -x instead.")
327 pure double _chgsign(double x);
328
329 //deprecated("Please use the standard C99 function isfinite() instead.")
330 pure int _finite(double x);
331
332 //deprecated("Please use the standard C99 function isnan() instead.")
333 pure int _isnan(double x);
334
335 //deprecated("Please use the standard C99 function fpclassify() instead.")
336 pure int _fpclass(double x);
337 }
338
339 version (MinGW)
340 {
341 enum
342 {
343 ///
344 FP_NAN = 0x0100,
345 ///
346 FP_NORMAL = 0x0400,
347 ///
348 FP_INFINITE = FP_NAN | FP_NORMAL,
349 ///
350 FP_ZERO = 0x0400,
351 ///
352 FP_SUBNORMAL = FP_NORMAL | FP_ZERO
353 }
354
355 pure int __fpclassifyf(float x);
356 pure int __fpclassify(double x);
357 pure int __fpclassifyl(real x);
358
359 pure int __isnanf(float x);
360 pure int __isnan(double x);
361 pure int __isnanl(real x);
362
363 pure int __signbitf(float x);
364 pure int __signbit(double x);
365 pure int __signbitl(real x);
366
367 //int fpclassify(real-floating x);
368 ///
369 pragma(mangle, "__fpclassifyf") pure int fpclassify(float x);
370 ///
371 pragma(mangle, "__fpclassify") pure int fpclassify(double x);
372 ///
373 pragma(mangle, real.sizeof == double.sizeof ? "__fpclassify" : "__fpclassifyl")
374 pure int fpclassify(real x);
375
376 extern (D)
377 {
378 //int isfinite(real-floating x);
379 ///
380 pure int isfinite(float x) { return (fpclassify(x) & FP_NORMAL) == 0; }
381 ///
382 pure int isfinite(double x) { return (fpclassify(x) & FP_NORMAL) == 0; }
383 ///
384 pure int isfinite(real x) { return (fpclassify(x) & FP_NORMAL) == 0; }
385
386 //int isinf(real-floating x);
387 ///
388 pure int isinf(float x) { return fpclassify(x) == FP_INFINITE; }
389 ///
390 pure int isinf(double x) { return fpclassify(x) == FP_INFINITE; }
391 ///
392 pure int isinf(real x) { return fpclassify(x) == FP_INFINITE; }
393 }
394
395 //int isnan(real-floating x);
396 ///
397 pragma(mangle, "__isnanf") pure int isnan(float x);
398 ///
399 pragma(mangle, "__isnan") pure int isnan(double x);
400 ///
401 pragma(mangle, real.sizeof == double.sizeof ? "__isnan" : "__isnanl")
402 pure int isnan(real x);
403
404 extern (D)
405 {
406 //int isnormal(real-floating x);
407 ///
408 int isnormal(float x) { return fpclassify(x) == FP_NORMAL; }
409 ///
410 int isnormal(double x) { return fpclassify(x) == FP_NORMAL; }
411 ///
412 int isnormal(real x) { return fpclassify(x) == FP_NORMAL; }
413 }
414
415 //int signbit(real-floating x);
416 ///
417 pragma(mangle, "__signbitf") pure int signbit(float x);
418 ///
419 pragma(mangle, "__signbit") pure int signbit(double x);
420 ///
421 pragma(mangle, real.sizeof == double.sizeof ? "__signbit" : "__signbitl")
422 int signbit(real x);
423 }
424 else
425 {
426 enum
427 {
428 ///
429 FP_SUBNORMAL = -2,
430 ///
431 FP_NORMAL = -1,
432 ///
433 FP_ZERO = 0,
434 ///
435 FP_INFINITE = 1,
436 ///
437 FP_NAN = 2,
438 }
439
440 extern(D)
441 {
442 //int fpclassify(real-floating x);
443 ///
444 extern(C) pragma(mangle, "_fdclass") pure int fpclassify(float x);
445 ///
446 extern(C) pragma(mangle, "_dclass") pure int fpclassify(double x);
447 ///
448 pure int fpclassify()(real x)
449 {
450 static if (real.sizeof == double.sizeof)
451 return fpclassify(cast(double) x);
452 else
453 static assert(false, "fpclassify(real) not supported by MS C runtime");
454 }
455
456 //int isfinite(real-floating x);
457 ///
458 pure int isfinite()(float x) { return fpclassify(x) <= 0; }
459 ///
460 pure int isfinite()(double x) { return fpclassify(x) <= 0; }
461 ///
462 pure int isfinite()(real x) { return fpclassify(x) <= 0; }
463
464 //int isinf(real-floating x);
465 ///
466 pure int isinf()(float x) { return fpclassify(x) == FP_INFINITE; }
467 ///
468 pure int isinf()(double x) { return fpclassify(x) == FP_INFINITE; }
469 ///
470 pure int isinf()(real x) { return fpclassify(x) == FP_INFINITE; }
471
472 //int isnan(real-floating x);
473 version (none) // requires MSVCRT 12+ (VS 2013)
474 {
475 ///
476 pure int isnan(float x) { return fpclassify(x) == FP_NAN; }
477 ///
478 pure int isnan(double x) { return fpclassify(x) == FP_NAN; }
479 ///
480 pure int isnan(real x) { return fpclassify(x) == FP_NAN; }
481 }
482 else // for backward compatibility with older runtimes
483 {
484 ///
485 pure int isnan(float x) { version (Win64) return _isnanf(x); else return _isnan(cast(double) x); }
486 ///
487 extern(C) pragma(mangle, "_isnan") pure int isnan(double x);
488 ///
489 pure int isnan(real x) { return _isnan(cast(double) x); }
490 }
491
492 //int isnormal(real-floating x);
493 ///
494 pure int isnormal()(float x) { return fpclassify(x) == FP_NORMAL; }
495 ///
496 pure int isnormal()(double x) { return fpclassify(x) == FP_NORMAL; }
497 ///
498 pure int isnormal()(real x) { return fpclassify(x) == FP_NORMAL; }
499
500 //int signbit(real-floating x);
501 ///
502 extern(C) pragma(mangle, "_fdsign") pure int signbit(float x);
503 ///
504 extern(C) pragma(mangle, "_dsign") pure int signbit(double x);
505 ///
506 pure int signbit()(real x)
507 {
508 static if (real.sizeof == double.sizeof)
509 return signbit(cast(double) x);
510 else
511 return (cast(short*)&(x))[4] & 0x8000;
512 }
513 }
514 }
515 }
516 else version (CRuntime_Glibc)
517 {
518 enum
519 {
520 ///
521 FP_NAN,
522 ///
523 FP_INFINITE,
524 ///
525 FP_ZERO,
526 ///
527 FP_SUBNORMAL,
528 ///
529 FP_NORMAL,
530 }
531
532 enum
533 {
534 ///
535 FP_FAST_FMA = 0,
536 ///
537 FP_FAST_FMAF = 0,
538 ///
539 FP_FAST_FMAL = 0,
540 }
541
542 pure int __fpclassifyf(float x);
543 pure int __fpclassify(double x);
544 pure int __fpclassifyl(real x);
545
546 pure int __finitef(float x);
547 pure int __finite(double x);
548 pure int __finitel(real x);
549
550 pure int __isinff(float x);
551 pure int __isinf(double x);
552 pure int __isinfl(real x);
553
554 pure int __isnanf(float x);
555 pure int __isnan(double x);
556 pure int __isnanl(real x);
557
558 pure int __signbitf(float x);
559 pure int __signbit(double x);
560 pure int __signbitl(real x);
561
562 //int fpclassify(real-floating x);
563 ///
564 pragma(mangle, "__fpclassifyf") pure int fpclassify(float x);
565 ///
566 pragma(mangle, "__fpclassify") pure int fpclassify(double x);
567 ///
568 pragma(mangle, real.sizeof == double.sizeof ? "__fpclassify" : "__fpclassifyl")
569 pure int fpclassify(real x);
570
571 //int isfinite(real-floating x);
572 ///
573 pragma(mangle, "__finitef") pure int isfinite(float x);
574 ///
575 pragma(mangle, "__finite") pure int isfinite(double x);
576 ///
577 pragma(mangle, real.sizeof == double.sizeof ? "__finite" : "__finitel")
578 pure int isfinite(real x);
579
580 //int isinf(real-floating x);
581 ///
582 pragma(mangle, "__isinff") pure int isinf(float x);
583 ///
584 pragma(mangle, "__isinf") pure int isinf(double x);
585 ///
586 pragma(mangle, real.sizeof == double.sizeof ? "__isinf" : "__isinfl")
587 pure int isinf(real x);
588
589 //int isnan(real-floating x);
590 ///
591 pragma(mangle, "__isnanf") pure int isnan(float x);
592 ///
593 pragma(mangle, "__isnan") pure int isnan(double x);
594 ///
595 pragma(mangle, real.sizeof == double.sizeof ? "__isnan" : "__isnanl")
596 pure int isnan(real x);
597
598 //int isnormal(real-floating x);
599 ///
600 extern (D) pure int isnormal(float x) { return fpclassify(x) == FP_NORMAL; }
601 ///
602 extern (D) pure int isnormal(double x) { return fpclassify(x) == FP_NORMAL; }
603 ///
604 extern (D) pure int isnormal(real x) { return fpclassify(x) == FP_NORMAL; }
605
606 //int signbit(real-floating x);
607 ///
608 pragma(mangle, "__signbitf") pure int signbit(float x);
609 ///
610 pragma(mangle, "__signbit") pure int signbit(double x);
611 ///
612 pragma(mangle, real.sizeof == double.sizeof ? "__signbit" : "__signbitl")
613 pure int signbit(real x);
614 }
615 else version (CRuntime_Musl)
616 {
617 enum
618 {
619 ///
620 FP_NAN,
621 ///
622 FP_INFINITE,
623 ///
624 FP_ZERO,
625 ///
626 FP_SUBNORMAL,
627 ///
628 FP_NORMAL,
629 }
630
631 enum
632 {
633 ///
634 FP_FAST_FMA = 0,
635 ///
636 FP_FAST_FMAF = 0,
637 ///
638 FP_FAST_FMAL = 0,
639 }
640
641 pure {
642 int __fpclassifyf(float x);
643 int __fpclassify(double x);
644 int __fpclassifyl(real x);
645
646 int __signbitf(float x);
647 int __signbit(double x);
648 int __signbitl(real x);
649 }
650
651 //int fpclassify(real-floating x);
652 ///
653 pragma(mangle, "__fpclassifyf") pure int fpclassify(float x);
654 ///
655 pragma(mangle, "__fpclassify") pure int fpclassify(double x);
656 ///
657 pragma(mangle, real.sizeof == double.sizeof ? "__fpclassify" : "__fpclassifyl")
658 pure int fpclassify(real x);
659 extern (D) pure
660 {
661 private uint __FLOAT_BITS(float __f)
662 {
663 union __u_t {
664 float __f;
665 uint __i;
666 }
667 __u_t __u;
668 __u.__f = __f;
669 return __u.__i;
670 }
671 private ulong __DOUBLE_BITS(double __f)
672 {
673 union __u_t {
674 double __f;
675 ulong __i;
676 }
677 __u_t __u;
678 __u.__f = __f;
679 return __u.__i;
680 }
681
682 //int isfinite(real-floating x);
683 ///
684 int isfinite(float x) { return (__FLOAT_BITS(x) & 0x7fffffff) < 0x7f800000; }
685 ///
686 int isfinite(double x) { return (__DOUBLE_BITS(x) & -1UL>>1) < 0x7ffUL<<52; }
687 ///
688 int isfinite(real x)
689 {
690 return (real.sizeof == double.sizeof)
691 ? isfinite(cast(double)x)
692 : __fpclassifyl(x) > FP_INFINITE;
693 }
694
695 //int isinf(real-floating x);
696 ///
697 int isinf(float x) { return (__FLOAT_BITS(x) & 0x7fffffff) == 0x7f800000; }
698 ///
699 int isinf(double x) { return (__DOUBLE_BITS(x) & -1UL>>1) == 0x7ffUL<<52; }
700 ///
701 int isinf(real x)
702 {
703 return (real.sizeof == double.sizeof)
704 ? isinf(cast(double)x)
705 : __fpclassifyl(x) == FP_INFINITE;
706 }
707
708 //int isnan(real-floating x);
709 ///
710 int isnan(float x) { return (__FLOAT_BITS(x) & 0x7fffffff) > 0x7f800000; }
711 ///
712 int isnan(double x) { return (__DOUBLE_BITS(x) & -1UL>>1) > 0x7ffUL<<52; }
713 ///
714 int isnan(real x)
715 {
716 return (real.sizeof == double.sizeof)
717 ? isnan(cast(double)x)
718 : __fpclassifyl(x) == FP_NAN;
719 }
720
721 //int isnormal(real-floating x);
722 ///
723 int isnormal(float x) { return fpclassify(x) == FP_NORMAL; }
724 ///
725 int isnormal(double x) { return fpclassify(x) == FP_NORMAL; }
726 ///
727 int isnormal(real x) { return fpclassify(x) == FP_NORMAL; }
728 }
729
730 //int signbit(real-floating x);
731 ///
732 pragma(mangle, "__signbitf") pure int signbit(float x);
733 ///
734 pragma(mangle, "__signbit") pure int signbit(double x);
735 ///
736 pragma(mangle, real.sizeof == double.sizeof ? "__signbit" : "__signbitl")
737 pure int signbit(real x);
738 }
739 else version (CRuntime_UClibc)
740 {
741 enum
742 {
743 ///
744 FP_NAN,
745 ///
746 FP_INFINITE,
747 ///
748 FP_ZERO,
749 ///
750 FP_SUBNORMAL,
751 ///
752 FP_NORMAL,
753 }
754
755 enum
756 {
757 ///
758 FP_FAST_FMA = 0,
759 ///
760 FP_FAST_FMAF = 0,
761 ///
762 FP_FAST_FMAL = 0,
763 }
764
765 pure int __fpclassifyf(float x);
766 pure int __fpclassify(double x);
767 pure int __fpclassifyl(real x);
768
769 pure int __finitef(float x);
770 pure int __finite(double x);
771 pure int __finitel(real x);
772
773 pure int __isinff(float x);
774 pure int __isinf(double x);
775 pure int __isinfl(real x);
776
777 pure int __isnanf(float x);
778 pure int __isnan(double x);
779 pure int __isnanl(real x);
780
781 pure int __signbitf(float x);
782 pure int __signbit(double x);
783 pure int __signbitl(real x);
784
785 ///
786 pragma(mangle, "__fpclassifyf") pure int fpclassify(float x);
787 ///
788 pragma(mangle, "__fpclassify") pure int fpclassify(double x);
789 ///
790 pragma(mangle, real.sizeof == double.sizeof ? "__fpclassify" : "__fpclassifyl")
791 pure int fpclassify(real x);
792
793 ///
794 pragma(mangle, "__finitef") pure int isfinite(float x);
795 ///
796 pragma(mangle, "__finite") pure int isfinite(double x);
797 ///
798 pragma(mangle, real.sizeof == double.sizeof ? "__finite" : "__finitel")
799 pure int isfinite(real x);
800
801 ///
802 pragma(mangle, "__isinff") pure int isinf(float x);
803 ///
804 pragma(mangle, "__isinf") pure int isinf(double x);
805 ///
806 pragma(mangle, real.sizeof == double.sizeof ? "__isinf" : "__isinfl")
807 pure int isinf(real x);
808
809 ///
810 pragma(mangle, "__isnanf") pure int isnan(float x);
811 ///
812 pragma(mangle, "__isnan") pure int isnan(double x);
813 ///
814 pragma(mangle, real.sizeof == double.sizeof ? "__isnan" : "__isnanl")
815 pure int isnan(real x);
816
817 extern (D) pure
818 {
819 ///
820 int isnormal(float x) { return fpclassify(x) == FP_NORMAL; }
821 ///
822 int isnormal(double x) { return fpclassify(x) == FP_NORMAL; }
823 ///
824 int isnormal(real x) { return fpclassify(x) == FP_NORMAL; }
825 }
826
827 ///
828 pragma(mangle, "__signbitf") pure int signbit(float x);
829 ///
830 pragma(mangle, "__signbit") pure int signbit(double x);
831 ///
832 pragma(mangle, real.sizeof == double.sizeof ? "__signbit" : "__signbitl")
833 pure int signbit(real x);
834 }
835 else version (Darwin)
836 {
837 enum
838 {
839 ///
840 FP_NAN = 1,
841 ///
842 FP_INFINITE = 2,
843 ///
844 FP_ZERO = 3,
845 ///
846 FP_NORMAL = 4,
847 ///
848 FP_SUBNORMAL = 5,
849 }
850
851 enum
852 {
853 ///
854 FP_FAST_FMA = 0,
855 ///
856 FP_FAST_FMAF = 0,
857 ///
858 FP_FAST_FMAL = 0,
859 }
860
861 pure int __fpclassifyf(float x);
862 pure int __fpclassifyd(double x);
863
864 pure int __isfinitef(float x);
865 pure int __isfinited(double x);
866
867 pure int __isinff(float x);
868 pure int __isinfd(double x);
869
870 pure int __isnanf(float x);
871 pure int __isnand(double x);
872
873 // __isnormal family exists, but iOS implementation returns wrong results
874 // for subnormals
875
876 pure int __signbitf(float x);
877 pure int __signbitd(double x);
878 pure int __signbitl(real x);
879
880 // Support of OSX < 10.8 needs legacy function names without "l" suffix
881 // with exception of __signbitl. Otherwise could use else version like
882 // other Darwins
883 version (OSX)
884 {
885 version (AArch64)
886 {
887 // Available in macOS ARM
888 pure int __fpclassifyl(real x);
889 pure int __isfinitel(real x);
890 pure int __isinfl(real x);
891 pure int __isnanl(real x);
892 }
893 else
894 {
895 pure int __fpclassify(real x);
896 pure int __isfinite(real x);
897 pure int __isinf(real x);
898 pure int __isnan(real x);
899 alias __fpclassifyl = __fpclassify;
900 alias __isfinitel = __isfinite;
901 alias __isinfl = __isinf;
902 alias __isnanl = __isnan;
903 }
904 }
905 else
906 {
907 // Available OSX >= 10.8, iOS >= 6.0, all TVOS and WatchOS
908 pure int __fpclassifyl(real x);
909 pure int __isfinitel(real x);
910 pure int __isinfl(real x);
911 pure int __isnanl(real x);
912 }
913
914 //int fpclassify(real-floating x);
915 ///
916 pragma(mangle, "__fpclassifyf") pure int fpclassify(float x);
917 ///
918 pragma(mangle, "__fpclassifyd") pure int fpclassify(double x);
919 ///
920 pragma(mangle, __fpclassifyl.mangleof) pure int fpclassify(real x);
921
922 //int isfinite(real-floating x);
923 ///
924 pragma(mangle, "__isfinitef") pure int isfinite(float x);
925 ///
926 pragma(mangle, "__isfinited") pure int isfinite(double x);
927 ///
928 pragma(mangle, __isfinitel.mangleof) pure int isfinite(real x);
929
930 //int isinf(real-floating x);
931 ///
932 pragma(mangle, "__isinff") pure int isinf(float x);
933 ///
934 pragma(mangle, "__isinfd") pure int isinf(double x);
935 ///
936 pragma(mangle, __isinfl.mangleof) pure int isinf(real x);
937
938 //int isnan(real-floating x);
939 ///
940 pragma(mangle, "__isnanf") pure int isnan(float x);
941 ///
942 pragma(mangle, "__isnand") pure int isnan(double x);
943 ///
944 pragma(mangle, __isnanl.mangleof) pure int isnan(real x);
945
946 extern (D)
947 {
948 //int isnormal(real-floating x);
949 ///
950 pure int isnormal(float x) { return fpclassify(x) == FP_NORMAL; }
951 ///
952 pure int isnormal(double x) { return fpclassify(x) == FP_NORMAL; }
953 ///
954 pure int isnormal(real x) { return fpclassify(x) == FP_NORMAL; }
955 }
956
957 //int signbit(real-floating x);
958 ///
959 pragma(mangle, "__signbitf") pure int signbit(float x);
960 ///
961 pragma(mangle, "__signbitd") pure int signbit(double x);
962 ///
963 pragma(mangle, "__signbitl") pure int signbit(real x);
964 }
965 else version (FreeBSD)
966 {
967 enum
968 {
969 ///
970 FP_INFINITE = 0x01,
971 ///
972 FP_NAN = 0x02,
973 ///
974 FP_NORMAL = 0x04,
975 ///
976 FP_SUBNORMAL = 0x08,
977 ///
978 FP_ZERO = 0x10,
979 }
980
981 enum
982 {
983 ///
984 FP_FAST_FMA = 0,
985 ///
986 FP_FAST_FMAF = 0,
987 ///
988 FP_FAST_FMAL = 0,
989 }
990
991 pure int __fpclassifyd(double);
992 pure int __fpclassifyf(float);
993 pure int __fpclassifyl(real);
994 pure int __isfinitef(float);
995 pure int __isfinite(double);
996 pure int __isfinitel(real);
997 pure int __isinff(float);
998 pure int __isinfl(real);
999 pure int __isnanl(real);
1000 pure int __isnormalf(float);
1001 pure int __isnormal(double);
1002 pure int __isnormall(real);
1003 pure int __signbit(double);
1004 pure int __signbitf(float);
1005 pure int __signbitl(real);
1006
1007 //int fpclassify(real-floating x);
1008 ///
1009 pragma(mangle, "__fpclassifyf") pure int fpclassify(float x);
1010 ///
1011 pragma(mangle, "__fpclassifyd") pure int fpclassify(double x);
1012 ///
1013 pragma(mangle, "__fpclassifyl") pure int fpclassify(real x);
1014
1015 //int isfinite(real-floating x);
1016 ///
1017 pragma(mangle, "__isfinitef") pure int isfinite(float x);
1018 ///
1019 pragma(mangle, "__isfinite") pure int isfinite(double x);
1020 ///
1021 pragma(mangle, "__isfinitel") pure int isfinite(real x);
1022
1023 //int isinf(real-floating x);
1024 ///
1025 pragma(mangle, "__isinff") pure int isinf(float x);
1026 ///
1027 extern (D) pure int isinf(double x) { return __isinfl(x); }
1028 ///
1029 pragma(mangle, "__isinfl") pure int isinf(real x);
1030
1031 //int isnan(real-floating x);
1032 ///
1033 extern (D) pure int isnan(float x) { return __isnanl(x); }
1034 ///
1035 extern (D) pure int isnan(double x) { return __isnanl(x); }
1036 ///
1037 pragma(mangle, "__isnanl") pure int isnan(real x);
1038
1039 //int isnormal(real-floating x);
1040 ///
1041 pragma(mangle, "__isnormalf") pure int isnormal(float x);
1042 ///
1043 pragma(mangle, "__isnormal") pure int isnormal(double x);
1044 ///
1045 pragma(mangle, "__isnormall") pure int isnormal(real x);
1046
1047 //int signbit(real-floating x);
1048 ///
1049 pragma(mangle, "__signbitf") pure int signbit(float x);
1050 ///
1051 pragma(mangle, "__signbit") pure int signbit(double x);
1052 ///
1053 extern (D) pure int signbit(real x) { return __signbit(x); }
1054 }
1055 else version (OpenBSD)
1056 {
1057 enum
1058 {
1059 ///
1060 FP_INFINITE = 0x01,
1061 ///
1062 FP_NAN = 0x02,
1063 ///
1064 FP_NORMAL = 0x04,
1065 ///
1066 FP_SUBNORMAL = 0x08,
1067 ///
1068 FP_ZERO = 0x10,
1069 }
1070
1071 enum
1072 {
1073 ///
1074 FP_FAST_FMA = 1,
1075 ///
1076 FP_FAST_FMAF = 1,
1077 ///
1078 FP_FAST_FMAL = 1,
1079 }
1080
1081 pure int __fpclassify(double);
1082 pure int __fpclassifyf(float);
1083 pure int __fpclassifyl(real);
1084 pure int __isfinitef(float);
1085 pure int __isfinite(double);
1086 pure int __isfinitel(real);
1087 pure int __isinff(float);
1088 pure int __isinfl(real);
1089 pure int __isnanl(real);
1090 pure int __isnormalf(float);
1091 pure int __isnormal(double);
1092 pure int __isnormall(real);
1093 pure int __signbit(double);
1094 pure int __signbitf(float);
1095 pure int __signbitl(real);
1096
1097 //int fpclassify(real-floating x);
1098 ///
1099 pragma(mangle, "__fpclassifyf") pure int fpclassify(float x);
1100 ///
1101 pragma(mangle, "__fpclassify") pure int fpclassify(double x);
1102 ///
1103 pragma(mangle, "__fpclassifyl") pure int fpclassify(real x);
1104
1105 //int isfinite(real-floating x);
1106 ///
1107 pragma(mangle, "__isfinitef") pure int isfinite(float x);
1108 ///
1109 pragma(mangle, "__isfinite") pure int isfinite(double x);
1110 ///
1111 pragma(mangle, "__isfinitel") pure int isfinite(real x);
1112
1113 //int isinf(real-floating x);
1114 ///
1115 pragma(mangle, "__isinff") pure int isinf(float x);
1116 ///
1117 extern (D) pure int isinf(double x) { return __isinfl(x); }
1118 ///
1119 pragma(mangle, "__isinfl") pure int isinf(real x);
1120
1121 //int isnan(real-floating x);
1122 ///
1123 extern (D) pure int isnan(float x) { return __isnanl(x); }
1124 ///
1125 extern (D) pure int isnan(double x) { return __isnanl(x); }
1126 ///
1127 pragma(mangle, "__isnanl") pure int isnan(real x);
1128
1129 //int isnormal(real-floating x);
1130 ///
1131 pragma(mangle, "__isnormalf") pure int isnormal(float x);
1132 ///
1133 pragma(mangle, "__isnormal") pure int isnormal(double x);
1134 ///
1135 pragma(mangle, "__isnormall") pure int isnormal(real x);
1136
1137 //int signbit(real-floating x);
1138 ///
1139 pragma(mangle, "__signbitf") pure int signbit(float x);
1140 ///
1141 pragma(mangle, "__signbit") pure int signbit(double x);
1142 ///
1143 extern (D) pure int signbit(real x) { return __signbit(x); }
1144 }
1145 else version (NetBSD)
1146 {
1147 enum
1148 {
1149 ///
1150 FP_INFINITE = 0,
1151 ///
1152 FP_NAN = 1,
1153 ///
1154 FP_NORMAL = 2,
1155 ///
1156 FP_SUBNORMAL = 3,
1157 ///
1158 FP_ZERO = 4,
1159 }
1160
1161 enum
1162 {
1163 ///
1164 FP_FAST_FMA = 0,
1165 ///
1166 FP_FAST_FMAF = 0,
1167 ///
1168 FP_FAST_FMAL = 0,
1169 }
1170
1171 pure uint __fpclassifyf(float x);
1172 pure uint __fpclassifyd(double x);
1173 pure uint __fpclassifyl(real x);
1174
1175 //int fpclassify(real-floating x);
1176 ///
1177 pragma(mangle, "__fpclassifyf") pure int fpclassify(float x);
1178 ///
1179 pragma(mangle, "__fpclassifyd") pure int fpclassify(double x);
1180 ///
1181 pragma(mangle, real.sizeof == double.sizeof ? "__fpclassifyd" : "__fpclassifyl")
1182 pure int fpclassify(real x);
1183
1184 extern (D)
1185 {
1186 //int isfinite(real-floating x);
1187 ///
1188 pure int isfinite(float x) { return fpclassify(x) >= FP_NORMAL; }
1189 ///
1190 pure int isfinite(double x) { return fpclassify(x) >= FP_NORMAL; }
1191 ///
1192 pure int isfinite(real x) { return fpclassify(x) >= FP_NORMAL; }
1193
1194 //int isinf(real-floating x);
1195 ///
1196 pure int isinf(float x) { return fpclassify(x) == FP_INFINITE; }
1197 ///
1198 pure int isinf(double x) { return fpclassify(x) == FP_INFINITE; }
1199 ///
1200 pure int isinf(real x) { return fpclassify(x) == FP_INFINITE; }
1201
1202 //int isnan(real-floating x);
1203 ///
1204 pure int isnan(float x) { return fpclassify(x) == FP_NAN; }
1205 ///
1206 pure int isnan(double x) { return fpclassify(x) == FP_NAN; }
1207 ///
1208 pure int isnan(real x) { return fpclassify(x) == FP_NAN; }
1209
1210 //int isnormal(real-floating x);
1211 ///
1212 pure int isnormal(float x) { return fpclassify(x) == FP_NORMAL; }
1213 ///
1214 pure int isnormal(double x) { return fpclassify(x) == FP_NORMAL; }
1215 ///
1216 pure int isnormal(real x) { return fpclassify(x) == FP_NORMAL; }
1217
1218 //int signbit(real-floating x);
1219 ///
1220 pure int signbit(float x) { return (cast(short*)&(x))[1] & 0x8000; }
1221 ///
1222 pure int signbit(double x) { return (cast(short*)&(x))[3] & 0x8000; }
1223 ///
1224 pure int signbit(real x)
1225 {
1226 return (real.sizeof == double.sizeof)
1227 ? (cast(short*)&(x))[3] & 0x8000
1228 : (cast(short*)&(x))[4] & 0x8000;
1229 }
1230 }
1231 }
1232 else version (DragonFlyBSD)
1233 {
1234 enum
1235 {
1236 FP_INFINITE = 0x01,
1237 FP_NAN = 0x02,
1238 FP_NORMAL = 0x04,
1239 FP_SUBNORMAL = 0x08,
1240 FP_ZERO = 0x10,
1241 }
1242
1243 /*
1244 * /usr/include/math.h : martynas@openbsd believes only F version is true.
1245 enum FP_FAST_FMA = 1;
1246 enum FP_FAST_FMAL = 1;
1247 */
1248 enum FP_FAST_FMAF = 1;
1249
1250 pure int __fpclassifyd(double);
1251 pure int __fpclassifyf(float);
1252 pure int __fpclassifyl(real);
1253 pure int __isfinitef(float);
1254 pure int __isfinite(double);
1255 pure int __isfinitel(real);
1256 pure int __isinff(float);
1257 pure int __isinf(double);
1258 pure int __isinfl(real);
1259 pure int __isnanf(float);
1260 pure int __isnan(double);
1261 pure int __isnanl(real);
1262 pure int __isnormalf(float);
1263 pure int __isnormal(double);
1264 pure int __isnormall(real);
1265 pure int __signbit(double);
1266 pure int __signbitf(float);
1267 pure int __signbitl(real);
1268
1269 pragma(mangle, "__fpclassifyf") pure int fpclassify(float x);
1270 pragma(mangle, "__fpclassifyd") pure int fpclassify(double x);
1271 pragma(mangle, "__fpclassifyl") pure int fpclassify(real x);
1272
1273 pragma(mangle, "__isfinitef") pure int isfinite(float x);
1274 pragma(mangle, "__isfinite") pure int isfinite(double x);
1275 pragma(mangle, "__isfinitel") pure int isfinite(real x);
1276
1277 pragma(mangle, "__isinff") pure int isinf(float x);
1278 pragma(mangle, "__isinf") pure int isinf(double x);
1279 pragma(mangle, "__isinfl") pure int isinf(real x);
1280
1281 pragma(mangle, "__isnanf") pure int isnan(float x);
1282 pragma(mangle, "__isnan") pure int isnan(double x);
1283 pragma(mangle, "__isnanl") pure int isnan(real x);
1284
1285 pragma(mangle, "__isnormalf") pure int isnormal(float x);
1286 pragma(mangle, "__isnormal") pure int isnormal(double x);
1287 pragma(mangle, "__isnormall") pure int isnormal(real x);
1288
1289 pragma(mangle, "__signbitf") pure int signbit(float x);
1290 pragma(mangle, "__signbit") pure int signbit(double x);
1291 pragma(mangle, "__signbitl") pure int signbit(real x);
1292 }
1293 else version (Solaris)
1294 {
1295 enum
1296 {
1297 FP_INFINITE = 3,
1298 FP_NAN = 4,
1299 FP_NORMAL = 2,
1300 FP_SUBNORMAL = 1,
1301 FP_ZERO = 0,
1302 }
1303
1304 enum
1305 {
1306 ///
1307 FP_FAST_FMA = 0,
1308 ///
1309 FP_FAST_FMAF = 0,
1310 ///
1311 FP_FAST_FMAL = 0,
1312 }
1313
1314 extern (D)
1315 {
1316 //int fpclassify(real-floating x);
1317 ///
1318 pure int fpclassify(float x)
1319 {
1320 return isnan(x) ? FP_NAN : isinf(x) ? FP_INFINITE :
1321 isnormal(x) ? FP_NORMAL : x == 0.0f ? FP_ZERO :
1322 FP_SUBNORMAL;
1323 }
1324
1325 ///
1326 pure int fpclassify(double x)
1327 {
1328 return isnan(x) ? FP_NAN : isinf(x) ? FP_INFINITE :
1329 isnormal(x) ? FP_NORMAL : x == 0.0 ? FP_ZERO :
1330 FP_SUBNORMAL;
1331 }
1332
1333 ///
1334 pure int fpclassify(real x)
1335 {
1336 return isnan(x) ? FP_NAN : isinf(x) ? FP_INFINITE :
1337 isnormal(x) ? FP_NORMAL : x == 0.0L ? FP_ZERO :
1338 FP_SUBNORMAL;
1339 }
1340
1341 //int isfinite(real-floating x);
1342 ///
1343 pure int isfinite(float x) { return !isnan(x) && !isinf(x); }
1344 ///
1345 pure int isfinite(double x) { return !isnan(x) && !isinf(x); }
1346 ///
1347 pure int isfinite(real x) { return !isnan(x) && !isinf(x); }
1348
1349 //int isinf(real-floating x);
1350 ///
1351 pure int isinf(float x) { return x == float.infinity || x == -float.infinity; }
1352 ///
1353 pure int isinf(double x) { return x == double.infinity || x == -double.infinity; }
1354 ///
1355 pure int isinf(real x) { return x == real.infinity || x == -real.infinity; }
1356
1357 //int isnan(real-floating x);
1358 ///
1359 pure int isnan(float x) { return x != x; }
1360 ///
1361 pure int isnan(double x) { return x != x; }
1362 ///
1363 pure int isnan(real x) { return x != x; }
1364
1365 //int isnormal(real-floating x);
1366 ///
1367 pure int isnormal(float x)
1368 {
1369 import core.math;
1370 return isfinite(x) && fabs(x) >= float.min_normal;
1371 }
1372 ///
1373 pure int isnormal(double x)
1374 {
1375 import core.math;
1376 return isfinite(x) && fabs(x) >= double.min_normal;
1377 }
1378 ///
1379 pure int isnormal(real x)
1380 {
1381 import core.math;
1382 return isfinite(x) && fabs(x) >= real.min_normal;
1383 }
1384
1385 //int signbit(real-floating x);
1386 ///
1387 pure int signbit(float x)
1388 {
1389 version (SPARC_Any)
1390 return cast(int)(*cast(uint*)&x >> 31);
1391 else version (X86_Any)
1392 return cast(int)(*cast(uint*)&x >> 31);
1393 else
1394 static assert(false, "Architecture not supported.");
1395 }
1396 ///
1397 pure int signbit(double x)
1398 {
1399 version (SPARC_Any)
1400 return cast(int)(*cast(uint*)&x >> 31);
1401 else version (X86_Any)
1402 return cast(int)((cast(uint*)&x)[1] >> 31);
1403 else
1404 static assert(false, "Architecture not supported.");
1405 }
1406 ///
1407 pure int signbit(real x)
1408 {
1409 version (SPARC_Any)
1410 return cast(int)(*cast(uint*)&x >> 31);
1411 else version (X86_Any)
1412 return cast(int)((cast(ushort *)&x)[4] >> 15);
1413 else
1414 static assert(false, "Architecture not supported.");
1415 }
1416 }
1417 }
1418 else version (CRuntime_Bionic)
1419 {
1420 enum
1421 {
1422 ///
1423 FP_INFINITE = 0x01,
1424 ///
1425 FP_NAN = 0x02,
1426 ///
1427 FP_NORMAL = 0x04,
1428 ///
1429 FP_SUBNORMAL = 0x08,
1430 ///
1431 FP_ZERO = 0x10,
1432 }
1433
1434 ///
1435 enum FP_FAST_FMAF;
1436
1437 pure int __fpclassifyd(double);
1438 pure int __fpclassifyf(float);
1439 pure int __fpclassifyl(real);
1440
1441 pure int __isfinitef(float);
1442 pure int __isfinite(double);
1443 pure int __isfinitel(real);
1444
1445 pure int __isinff(float);
1446 pure int __isinf(double);
1447 pure int __isinfl(real);
1448
1449 pure int isnanf(float);
1450 pure int isnan(double);
1451 pure int __isnanl(real);
1452
1453 pure int __isnormalf(float);
1454 pure int __isnormal(double);
1455 pure int __isnormall(real);
1456
1457 pure int __signbit(double);
1458 pure int __signbitf(float);
1459 pure int __signbitl(real);
1460
1461 //int fpclassify(real-floating x);
1462 ///
1463 pragma(mangle, "__fpclassifyf") pure int fpclassify(float x);
1464 ///
1465 pragma(mangle, "__fpclassifyd") pure int fpclassify(double x);
1466 ///
1467 pragma(mangle, "__fpclassifyl") pure int fpclassify(real x);
1468
1469 //int isfinite(real-floating x);
1470 ///
1471 pragma(mangle, "__isfinitef") pure int isfinite(float x);
1472 ///
1473 pragma(mangle, "__isfinite") pure int isfinite(double x);
1474 ///
1475 pragma(mangle, "__isfinitel") pure int isfinite(real x);
1476
1477 //int isinf(real-floating x);
1478 ///
1479 pragma(mangle, "__isinff") pure int isinf(float x);
1480 ///
1481 pragma(mangle, "__isinf") pure int isinf(double x);
1482 ///
1483 pragma(mangle, "__isinfl") pure int isinf(real x);
1484
1485 //int isnan(real-floating x);
1486 ///
1487 pragma(mangle, "isnanf") pure int isnan(float x);
1488 ///
1489 pragma(mangle, "__isnanl") pure int isnan(real x);
1490
1491 //int isnormal(real-floating x);
1492 ///
1493 pragma(mangle, "__isnormalf") pure int isnormal(float x);
1494 ///
1495 pragma(mangle, "__isnormal") pure int isnormal(double x);
1496 ///
1497 pragma(mangle, "__isnormall") pure int isnormal(real x);
1498
1499 //int signbit(real-floating x);
1500 ///
1501 pragma(mangle, "__signbitf") pure int signbit(float x);
1502 ///
1503 pragma(mangle, "__signbit") pure int signbit(double x);
1504 ///
1505 pragma(mangle, "__signbitl") pure int signbit(real x);
1506 }
1507
1508 extern (D)
1509 {
1510 //int isgreater(real-floating x, real-floating y);
1511 ///
1512 pure int isgreater(float x, float y) { return x > y; }
1513 ///
1514 pure int isgreater(double x, double y) { return x > y; }
1515 ///
1516 pure int isgreater(real x, real y) { return x > y; }
1517
1518 //int isgreaterequal(real-floating x, real-floating y);
1519 ///
1520 pure int isgreaterequal(float x, float y) { return x >= y; }
1521 ///
1522 pure int isgreaterequal(double x, double y) { return x >= y; }
1523 ///
1524 pure int isgreaterequal(real x, real y) { return x >= y; }
1525
1526 //int isless(real-floating x, real-floating y);
1527 ///
1528 pure int isless(float x, float y) { return x < y; }
1529 ///
1530 pure int isless(double x, double y) { return x < y; }
1531 ///
1532 pure int isless(real x, real y) { return x < y; }
1533
1534 //int islessequal(real-floating x, real-floating y);
1535 ///
1536 pure int islessequal(float x, float y) { return x <= y; }
1537 ///
1538 pure int islessequal(double x, double y) { return x <= y; }
1539 ///
1540 pure int islessequal(real x, real y) { return x <= y; }
1541
1542 //int islessgreater(real-floating x, real-floating y);
1543 ///
1544 pure int islessgreater(float x, float y) { return x != y && !isunordered(x, y); }
1545 ///
1546 pure int islessgreater(double x, double y) { return x != y && !isunordered(x, y); }
1547 ///
1548 pure int islessgreater(real x, real y) { return x != y && !isunordered(x, y); }
1549
1550 //int isunordered(real-floating x, real-floating y);
1551 ///
1552 pure int isunordered(float x, float y) { return isnan(x) || isnan(y); }
1553 ///
1554 pure int isunordered(double x, double y) { return isnan(x) || isnan(y); }
1555 ///
1556 pure int isunordered(real x, real y) { return isnan(x) || isnan(y); }
1557 }
1558
1559 /* MS define some functions inline.
1560 * Additionally, their *l functions work with a 64-bit long double and are thus
1561 * useless for 80-bit D reals. So we use our own wrapper implementations working
1562 * internally with reduced 64-bit precision.
1563 * This also enables relaxing real to 64-bit double.
1564 */
1565 version (CRuntime_Microsoft) // fully supported since MSVCRT 12 (VS 2013) only
1566 {
1567 ///
1568 double acos(double x);
1569 ///
1570 float acosf(float x);
1571 ///
1572 extern(D) real acosl()(real x) { return acos(cast(double) x); }
1573
1574 ///
1575 double asin(double x);
1576 ///
1577 float asinf(float x);
1578 ///
1579 extern(D) real asinl()(real x) { return asin(cast(double) x); }
1580
1581 ///
1582 pure double atan(double x);
1583 ///
1584 pure float atanf(float x);
1585 ///
1586 pure extern(D) real atanl()(real x) { return atan(cast(double) x); }
1587
1588 ///
1589 double atan2(double y, double x);
1590 ///
1591 float atan2f(float y, float x);
1592 ///
1593 extern(D) real atan2l()(real y, real x) { return atan2(cast(double) y, cast(double) x); }
1594
1595 ///
1596 pure double cos(double x);
1597 ///
1598 pure float cosf(float x);
1599 ///
1600 extern(D) pure real cosl()(real x) { return cos(cast(double) x); }
1601
1602 ///
1603 pure double sin(double x);
1604 ///
1605 pure float sinf(float x);
1606 ///
1607 extern(D) pure real sinl()(real x) { return sin(cast(double) x); }
1608
1609 ///
1610 pure double tan(double x);
1611 ///
1612 pure float tanf(float x);
1613 ///
1614 extern(D) pure real tanl()(real x) { return tan(cast(double) x); }
1615
1616 ///
1617 double acosh(double x);
1618 ///
1619 float acoshf(float x);
1620 ///
1621 extern(D) real acoshl()(real x) { return acosh(cast(double) x); }
1622
1623 ///
1624 pure double asinh(double x);
1625 ///
1626 pure float asinhf(float x);
1627 ///
1628 pure extern(D) real asinhl()(real x) { return asinh(cast(double) x); }
1629
1630 ///
1631 double atanh(double x);
1632 ///
1633 float atanhf(float x);
1634 ///
1635 extern(D) real atanhl()(real x) { return atanh(cast(double) x); }
1636
1637 ///
1638 double cosh(double x);
1639 ///
1640 float coshf(float x);
1641 ///
1642 extern(D) real coshl()(real x) { return cosh(cast(double) x); }
1643
1644 ///
1645 double sinh(double x);
1646 ///
1647 float sinhf(float x);
1648 ///
1649 extern(D) real sinhl()(real x) { return sinh(cast(double) x); }
1650
1651 ///
1652 pure double tanh(double x);
1653 ///
1654 pure float tanhf(float x);
1655 ///
1656 extern(D) pure real tanhl()(real x) { return tanh(cast(double) x); }
1657
1658 ///
1659 double exp(double x);
1660 ///
1661 float expf(float x);
1662 ///
1663 extern(D) real expl()(real x) { return exp(cast(double) x); }
1664
1665 ///
1666 double exp2(double x);
1667 ///
1668 float exp2f(float x);
1669 ///
1670 extern(D) real exp2l()(real x) { return exp2(cast(double) x); }
1671
1672 ///
1673 double expm1(double x);
1674 ///
1675 float expm1f(float x);
1676 ///
1677 extern(D) real expm1l()(real x) { return expm1(cast(double) x); }
1678
1679 ///
1680 pure double frexp(double value, int* exp);
1681 ///
1682 extern(D) pure float frexpf()(float value, int* exp) { return cast(float) frexp(value, exp); }
1683 ///
1684 extern(D) pure real frexpl()(real value, int* exp) { return frexp(cast(double) value, exp); }
1685
1686 ///
1687 int ilogb(double x);
1688 ///
1689 int ilogbf(float x);
1690 ///
1691 extern(D) int ilogbl()(real x) { return ilogb(cast(double) x); }
1692
1693 ///
1694 double ldexp(double x, int exp);
1695 ///
1696 extern(D) float ldexpf()(float x, int exp) { return cast(float) ldexp(x, exp); }
1697 ///
1698 extern(D) real ldexpl()(real x, int exp) { return ldexp(cast(double) x, exp); }
1699
1700 ///
1701 double log(double x);
1702 ///
1703 float logf(float x);
1704 ///
1705 extern(D) real logl()(real x) { return log(cast(double) x); }
1706
1707 ///
1708 double log10(double x);
1709 ///
1710 float log10f(float x);
1711 ///
1712 extern(D) real log10l()(real x) { return log10(cast(double) x); }
1713
1714 ///
1715 double log1p(double x);
1716 ///
1717 float log1pf(float x);
1718 ///
1719 extern(D) real log1pl()(real x) { return log1p(cast(double) x); }
1720
1721 ///
1722 double log2(double x);
1723 ///
1724 float log2f(float x);
1725 ///
1726 extern(D) real log2l()(real x) { return log2(cast(double) x); }
1727
1728 ///
1729 double logb(double x);
1730 ///
1731 float logbf(float x);
1732 ///
1733 extern(D) real logbl()(real x) { return logb(cast(double) x); }
1734
1735 ///
1736 pure double modf(double value, double* iptr);
1737 ///
1738 pure float modff(float value, float* iptr);
1739 ///
1740 extern(D) pure real modfl()(real value, real* iptr)
1741 {
1742 double i;
1743 double r = modf(cast(double) value, &i);
1744 *iptr = i;
1745 return r;
1746 }
1747
1748 ///
1749 double scalbn(double x, int n);
1750 ///
1751 float scalbnf(float x, int n);
1752 ///
1753 extern(D) real scalbnl()(real x, int n) { return scalbn(cast(double) x, n); }
1754
1755 ///
1756 double scalbln(double x, c_long n);
1757 ///
1758 float scalblnf(float x, c_long n);
1759 ///
1760 extern(D) real scalblnl()(real x, c_long n) { return scalbln(cast(double) x, n); }
1761
1762 ///
1763 pure double cbrt(double x);
1764 ///
1765 pure float cbrtf(float x);
1766 ///
1767 extern(D) pure real cbrtl()(real x) { return cbrt(cast(double) x); }
1768
1769 ///
1770 pure double fabs(double x);
1771 ///
1772 extern(D) pure float fabsf()(float x) { return cast(float) fabs(x); }
1773 ///
1774 extern(D) pure real fabsl()(real x) { return fabs(cast(double) x); }
1775
1776 ///
1777 extern(C) pragma(mangle, "_hypot") double hypot(double x, double y);
1778 ///
1779 extern(C) pragma(mangle, "_hypotf") float hypotf(float x, float y);
1780 ///
1781 extern(D) real hypotl(real x, real y) { return hypot(cast(double) x, cast(double) y); }
1782
1783 ///
1784 double pow(double x, double y);
1785 ///
1786 float powf(float x, float y);
1787 ///
1788 extern(D) real powl()(real x, real y) { return pow(cast(double) x, cast(double) y); }
1789
1790 ///
1791 double sqrt(double x);
1792 ///
1793 float sqrtf(float x);
1794 ///
1795 extern(D) real sqrtl()(real x) { return sqrt(cast(double) x); }
1796
1797 ///
1798 pure double erf(double x);
1799 ///
1800 pure float erff(float x);
1801 ///
1802 extern(D) pure real erfl()(real x) { return erf(cast(double) x); }
1803
1804 ///
1805 double erfc(double x);
1806 ///
1807 float erfcf(float x);
1808 ///
1809 extern(D) real erfcl()(real x) { return erfc(cast(double) x); }
1810
1811 ///
1812 double lgamma(double x);
1813 ///
1814 float lgammaf(float x);
1815 ///
1816 extern(D) real lgammal()(real x) { return lgamma(cast(double) x); }
1817
1818 ///
1819 double tgamma(double x);
1820 ///
1821 float tgammaf(float x);
1822 ///
1823 extern(D) real tgammal()(real x) { return tgamma(cast(double) x); }
1824
1825 ///
1826 pure double ceil(double x);
1827 ///
1828 pure float ceilf(float x);
1829 ///
1830 extern(D) pure real ceill()(real x) { return ceil(cast(double) x); }
1831
1832 ///
1833 pure double floor(double x);
1834 ///
1835 pure float floorf(float x);
1836 ///
1837 extern(D) pure real floorl()(real x) { return floor(cast(double) x); }
1838
1839 ///
1840 pure double nearbyint(double x);
1841 ///
1842 pure float nearbyintf(float x);
1843 ///
1844 extern(D) pure real nearbyintl()(real x) { return nearbyint(cast(double) x); }
1845
1846 ///
1847 pure double rint(double x);
1848 ///
1849 pure float rintf(float x);
1850 ///
1851 extern(D) pure real rintl()(real x) { return rint(cast(double) x); }
1852
1853 ///
1854 c_long lrint(double x);
1855 ///
1856 c_long lrintf(float x);
1857 ///
1858 extern(D) c_long lrintl()(real x) { return lrint(cast(double) x); }
1859
1860 ///
1861 long llrint(double x);
1862 ///
1863 long llrintf(float x);
1864 ///
1865 extern(D) long llrintl()(real x) { return llrint(cast(double) x); }
1866
1867 ///
1868 pure double round(double x);
1869 ///
1870 pure float roundf(float x);
1871 ///
1872 extern(D) pure real roundl()(real x) { return round(cast(double) x); }
1873
1874 ///
1875 c_long lround(double x);
1876 ///
1877 c_long lroundf(float x);
1878 ///
1879 extern(D) c_long lroundl()(real x) { return lround(cast(double) x); }
1880
1881 ///
1882 long llround(double x);
1883 ///
1884 long llroundf(float x);
1885 ///
1886 extern(D) long llroundl()(real x) { return llround(cast(double) x); }
1887
1888 ///
1889 pure double trunc(double x);
1890 ///
1891 pure float truncf(float x);
1892 ///
1893 extern(D) pure real truncl()(real x) { return trunc(cast(double) x); }
1894
1895 ///
1896 double fmod(double x, double y);
1897 ///
1898 float fmodf(float x, float y);
1899 ///
1900 extern(D) real fmodl()(real x, real y) { return fmod(cast(double) x, cast(double) y); }
1901
1902 ///
1903 double remainder(double x, double y);
1904 ///
1905 float remainderf(float x, float y);
1906 ///
1907 extern(D) real remainderl()(real x, real y) { return remainder(cast(double) x, cast(double) y); }
1908
1909 ///
1910 double remquo(double x, double y, int* quo);
1911 ///
1912 float remquof(float x, float y, int* quo);
1913 ///
1914 extern(D) real remquol()(real x, real y, int* quo) { return remquo(cast(double) x, cast(double) y, quo); }
1915
1916 ///
1917 pure double copysign(double x, double y);
1918 ///
1919 pure float copysignf(float x, float y);
1920 ///
1921 extern(D) pure real copysignl()(real x, real y) { return copysign(cast(double) x, cast(double) y); }
1922
1923 ///
1924 pure double nan(char* tagp);
1925 ///
1926 pure float nanf(char* tagp);
1927 ///
1928 extern(D) pure real nanl()(char* tagp) { return nan(tagp); }
1929
1930 ///
1931 double nextafter(double x, double y);
1932 ///
1933 float nextafterf(float x, float y);
1934 ///
1935 extern(D) real nextafterl()(real x, real y) { return nextafter(cast(double) x, cast(double) y); }
1936
1937 ///
1938 double nexttoward(double x, real y);
1939 ///
1940 float nexttowardf(float x, real y);
1941 ///
1942 extern(D) real nexttowardl()(real x, real y) { return nexttoward(cast(double) x, cast(double) y); }
1943
1944 ///
1945 double fdim(double x, double y);
1946 ///
1947 float fdimf(float x, float y);
1948 ///
1949 extern(D) real fdiml()(real x, real y) { return fdim(cast(double) x, cast(double) y); }
1950
1951 ///
1952 pure double fmax(double x, double y);
1953 ///
1954 pure float fmaxf(float x, float y);
1955 ///
1956 extern(D) pure real fmaxl()(real x, real y) { return fmax(cast(double) x, cast(double) y); }
1957
1958 ///
1959 pure double fmin(double x, double y);
1960 ///
1961 pure float fminf(float x, float y);
1962 ///
1963 extern(D) pure real fminl()(real x, real y) { return fmin(cast(double) x, cast(double) y); }
1964
1965 ///
1966 pure double fma(double x, double y, double z);
1967 ///
1968 pure float fmaf(float x, float y, float z);
1969 ///
1970 extern(D) pure real fmal()(real x, real y, real z) { return fma(cast(double) x, cast(double) y, cast(double) z); }
1971 }
1972 else version (FreeBSD)
1973 {
1974 ///
1975 double acos(double x);
1976 ///
1977 float acosf(float x);
1978 ///
1979 real acosl(real x); // since 8.0
1980
1981 ///
1982 double asin(double x);
1983 ///
1984 float asinf(float x);
1985 ///
1986 real asinl(real x); // since 8.0
1987
1988 ///
1989 pure double atan(double x);
1990 ///
1991 pure float atanf(float x);
1992 ///
1993 pure real atanl(real x); // since 8.0
1994
1995 ///
1996 double atan2(double y, double x);
1997 ///
1998 float atan2f(float y, float x);
1999 ///
2000 real atan2l(real y, real x); // since 8.0
2001
2002 ///
2003 pure double cos(double x);
2004 ///
2005 pure float cosf(float x);
2006 ///
2007 pure real cosl(real x); // since 8.0
2008
2009 ///
2010 pure double sin(double x);
2011 ///
2012 pure float sinf(float x);
2013 ///
2014 pure real sinl(real x); // since 8.0
2015
2016 ///
2017 pure double tan(double x);
2018 ///
2019 pure float tanf(float x);
2020 ///
2021 pure real tanl(real x); // since 8.0
2022
2023 ///
2024 double acosh(double x);
2025 ///
2026 float acoshf(float x);
2027 ///
2028 real acoshl(real x); // since 10.0
2029
2030 ///
2031 pure double asinh(double x);
2032 ///
2033 pure float asinhf(float x);
2034 ///
2035 pure real asinhl(real x); // since 10.0
2036
2037 ///
2038 double atanh(double x);
2039 ///
2040 float atanhf(float x);
2041 ///
2042 real atanhl(real x); // since 10.0
2043
2044 ///
2045 double cosh(double x);
2046 ///
2047 float coshf(float x);
2048 ///
2049 real coshl(real x); // since 10.1
2050
2051 ///
2052 double sinh(double x);
2053 ///
2054 float sinhf(float x);
2055 ///
2056 real sinhl(real x); // since 10.1
2057
2058 ///
2059 pure double tanh(double x);
2060 ///
2061 pure float tanhf(float x);
2062 ///
2063 pure real tanhl(real x); // since 10.1
2064
2065 ///
2066 double exp(double x);
2067 ///
2068 float expf(float x);
2069 ///
2070 real expl(real x); // since 10.0
2071
2072 ///
2073 double exp2(double x);
2074 ///
2075 float exp2f(float x);
2076 ///
2077 real exp2l(real x); // since 8.0
2078
2079 ///
2080 double expm1(double x);
2081 ///
2082 float expm1f(float x);
2083 ///
2084 real expm1l(real x); // since 10.0
2085
2086 ///
2087 pure double frexp(double value, int* exp);
2088 ///
2089 pure float frexpf(float value, int* exp);
2090 ///
2091 pure real frexpl(real value, int* exp); // since 6.0
2092
2093 ///
2094 int ilogb(double x);
2095 ///
2096 int ilogbf(float x);
2097 ///
2098 int ilogbl(real x); // since 5.4
2099
2100 ///
2101 double ldexp(double x, int exp);
2102 ///
2103 float ldexpf(float x, int exp);
2104 ///
2105 real ldexpl(real x, int exp); // since 6.0
2106
2107 ///
2108 double log(double x);
2109 ///
2110 float logf(float x);
2111 ///
2112 real logl(real x); // since 10.0
2113
2114 ///
2115 double log10(double x);
2116 ///
2117 float log10f(float x);
2118 ///
2119 real log10l(real x); // since 10.0
2120
2121 ///
2122 double log1p(double x);
2123 ///
2124 float log1pf(float x);
2125 ///
2126 real log1pl(real x); // since 10.0
2127
2128 ///
2129 double log2(double x); // since 8.3
2130 ///
2131 float log2f(float x); // since 8.3
2132 ///
2133 real log2l(real x); // since 10.0
2134
2135 ///
2136 double logb(double x);
2137 ///
2138 float logbf(float x);
2139 ///
2140 real logbl(real x); // since 8.0
2141
2142 ///
2143 pure double modf(double value, double* iptr);
2144 ///
2145 pure float modff(float value, float* iptr);
2146 ///
2147 pure real modfl(real value, real *iptr); // since 8.0
2148
2149 ///
2150 double scalbn(double x, int n);
2151 ///
2152 float scalbnf(float x, int n);
2153 ///
2154 real scalbnl(real x, int n); // since 6.0
2155
2156 ///
2157 double scalbln(double x, c_long n);
2158 ///
2159 float scalblnf(float x, c_long n);
2160 ///
2161 real scalblnl(real x, c_long n); // since 6.0
2162
2163 ///
2164 pure double cbrt(double x);
2165 ///
2166 pure float cbrtf(float x);
2167 ///
2168 pure real cbrtl(real x); // since 9.0
2169
2170 ///
2171 pure double fabs(double x);
2172 ///
2173 pure float fabsf(float x);
2174 ///
2175 pure real fabsl(real x); // since 5.3
2176
2177 ///
2178 double hypot(double x, double y);
2179 ///
2180 float hypotf(float x, float y);
2181 ///
2182 real hypotl(real x, real y); // since 8.0
2183
2184 ///
2185 double pow(double x, double y);
2186 ///
2187 float powf(float x, float y);
2188 ///
2189 real powl(real x, real y); // since 10.4
2190
2191 ///
2192 double sqrt(double x);
2193 ///
2194 float sqrtf(float x);
2195 ///
2196 real sqrtl(real x); // since 8.0
2197
2198 ///
2199 pure double erf(double x);
2200 ///
2201 pure float erff(float x);
2202 ///
2203 pure real erfl(real x); // since 10.1
2204
2205 ///
2206 double erfc(double x);
2207 ///
2208 float erfcf(float x);
2209 ///
2210 real erfcl(real x); // since 10.1
2211
2212 ///
2213 double lgamma(double x);
2214 ///
2215 float lgammaf(float x);
2216 ///
2217 real lgammal(real x); // since 10.2
2218
2219 ///
2220 double tgamma(double x);
2221 ///
2222 float tgammaf(float x);
2223 ///
2224 real tgammal(real x); // since 11.2
2225
2226 ///
2227 pure double ceil(double x);
2228 ///
2229 pure float ceilf(float x);
2230 ///
2231 pure real ceill(real x); // since 5.4
2232
2233 ///
2234 pure double floor(double x);
2235 ///
2236 pure float floorf(float x);
2237 ///
2238 pure real floorl(real x); // since 5.4
2239
2240 ///
2241 pure double nearbyint(double x);
2242 ///
2243 pure float nearbyintf(float x);
2244 ///
2245 pure real nearbyintl(real x); // since 8.0
2246
2247 ///
2248 pure double rint(double x);
2249 ///
2250 pure float rintf(float x);
2251 ///
2252 pure real rintl(real x); // since 8.0
2253
2254 ///
2255 c_long lrint(double x);
2256 ///
2257 c_long lrintf(float x);
2258 ///
2259 c_long lrintl(real x); // since 8.0
2260
2261 ///
2262 long llrint(double x);
2263 ///
2264 long llrintf(float x);
2265 ///
2266 long llrintl(real x); // since 8.0
2267
2268 ///
2269 pure double round(double x);
2270 ///
2271 pure float roundf(float x);
2272 ///
2273 pure real roundl(real x); // since 6.0
2274
2275 ///
2276 c_long lround(double x);
2277 ///
2278 c_long lroundf(float x);
2279 ///
2280 c_long lroundl(real x); // since 6.0
2281
2282 ///
2283 long llround(double x);
2284 ///
2285 long llroundf(float x);
2286 ///
2287 long llroundl(real x); // since 6.0
2288
2289 ///
2290 pure double trunc(double x);
2291 ///
2292 pure float truncf(float x);
2293 ///
2294 pure real truncl(real x); // since 6.0
2295
2296 ///
2297 double fmod(double x, double y);
2298 ///
2299 float fmodf(float x, float y);
2300 ///
2301 real fmodl(real x, real y); // since 8.0
2302
2303 ///
2304 double remainder(double x, double y);
2305 ///
2306 float remainderf(float x, float y);
2307 ///
2308 real remainderl(real x, real y); // since 8.0
2309
2310 ///
2311 double remquo(double x, double y, int* quo);
2312 ///
2313 float remquof(float x, float y, int* quo);
2314 ///
2315 real remquol(real x, real y, int* quo); // since 8.0
2316
2317 ///
2318 pure double copysign(double x, double y);
2319 ///
2320 pure float copysignf(float x, float y);
2321 ///
2322 pure real copysignl(real x, real y); // since 5.3
2323
2324 ///
2325 pure double nan(const char*); // since 8.0
2326 ///
2327 pure float nanf(const char*); // since 8.0
2328 ///
2329 pure real nanl(const char*); // since 8.0
2330
2331 ///
2332 double nextafter(double x, double y);
2333 ///
2334 float nextafterf(float x, float y);
2335 ///
2336 real nextafterl(real x, real y); // since 6.0
2337
2338 ///
2339 double nexttoward(double x, real y);
2340 ///
2341 float nexttowardf(float x, real y);
2342 ///
2343 real nexttowardl(real x, real y); // since 6.0
2344
2345 ///
2346 double fdim(double x, double y);
2347 ///
2348 float fdimf(float x, float y);
2349 ///
2350 real fdiml(real x, real y); // since 5.3
2351
2352 ///
2353 pure double fmax(double x, double y);
2354 ///
2355 pure float fmaxf(float x, float y);
2356 ///
2357 pure real fmaxl(real x, real y); // since 5.3
2358
2359 ///
2360 pure double fmin(double x, double y);
2361 ///
2362 pure float fminf(float x, float y);
2363 ///
2364 pure real fminl(real x, real y); // since 5.3
2365
2366 ///
2367 pure double fma(double x, double y, double z);
2368 ///
2369 pure float fmaf(float x, float y, float z);
2370 ///
2371 pure real fmal(real x, real y, real z); // since 6.0
2372 }
2373 else version (NetBSD)
2374 {
2375
2376 ///
2377 real acosl(real x);
2378 ///
2379 real asinl(real x);
2380 ///
2381 pure real atanl(real x);
2382 ///
2383 real atan2l(real y, real x);
2384 ///
2385 pure real cosl(real x);
2386 ///
2387 pure real sinl(real x);
2388 ///
2389 pure real tanl(real x);
2390 ///
2391 real exp2l(real x);
2392 ///
2393 pure real frexpl(real value, int* exp);
2394 ///
2395 int ilogbl(real x);
2396 ///
2397 real ldexpl(real x, int exp);
2398 ///
2399 real logbl(real x);
2400 ///
2401 pure real modfl(real value, real *iptr);
2402 ///
2403 real scalbnl(real x, int n);
2404 ///
2405 real scalblnl(real x, c_long n);
2406 ///
2407 pure real fabsl(real x);
2408 ///
2409 real hypotl(real x, real y);
2410 ///
2411 real sqrtl(real x);
2412 ///
2413 pure real ceill(real x);
2414 ///
2415 pure real floorl(real x);
2416 ///
2417 pure real nearbyintl(real x);
2418 ///
2419 pure real rintl(real x);
2420 ///
2421 extern(D) c_long lrintl(real x) { return cast(c_long)rintl(x); }
2422 ///
2423 pure real roundl(real x);
2424 ///
2425 extern(D) c_long lroundl(real x) { return cast(c_long)roundl(x);}
2426 ///
2427 extern(D) long llroundl(real x) { return cast(long)roundl(x);}
2428 ///
2429 pure real truncl(real x);
2430 ///
2431 real fmodl(real x, real y);
2432 ///
2433 real remainderl(real x, real y) { return remainder(x,y); }
2434 ///
2435 real remquol(real x, real y, int* quo){ return remquo(x,y,quo); }
2436 ///
2437 pure real copysignl(real x, real y);
2438 ///
2439 pure double nan(char* tagp);
2440 ///
2441 pure float nanf(char* tagp);
2442 ///
2443 pure real nanl(char* tagp);
2444 ///
2445 real nextafterl(real x, real y);
2446 ///
2447 extern(D) real nexttowardl(real x, real y) { return nexttoward(cast(double) x, cast(double) y); }
2448 ///
2449 real fdiml(real x, real y);
2450 ///
2451 pure real fmaxl(real x, real y);
2452 ///
2453 pure real fminl(real x, real y);
2454 ///
2455 pure real fmal(real x, real y, real z);
2456
2457 ///
2458 double acos(double x);
2459 ///
2460 float acosf(float x);
2461
2462 ///
2463 double asin(double x);
2464 ///
2465 float asinf(float x);
2466
2467 ///
2468 pure double atan(double x);
2469 ///
2470 pure float atanf(float x);
2471
2472 ///
2473 double atan2(double y, double x);
2474 ///
2475 float atan2f(float y, float x);
2476
2477 ///
2478 pure double cos(double x);
2479 ///
2480 pure float cosf(float x);
2481
2482 ///
2483 pure double sin(double x);
2484 ///
2485 pure float sinf(float x);
2486
2487 ///
2488 pure double tan(double x);
2489 ///
2490 pure float tanf(float x);
2491
2492 ///
2493 double acosh(double x);
2494 ///
2495 float acoshf(float x);
2496 ///
2497 real acoshl(real x);
2498
2499 ///
2500 pure double asinh(double x);
2501 ///
2502 pure float asinhf(float x);
2503 ///
2504 pure real asinhl(real x);
2505
2506 ///
2507 double atanh(double x);
2508 ///
2509 float atanhf(float x);
2510 ///
2511 real atanhl(real x);
2512
2513 ///
2514 double cosh(double x);
2515 ///
2516 float coshf(float x);
2517 ///
2518 real coshl(real x);
2519
2520 ///
2521 double sinh(double x);
2522 ///
2523 float sinhf(float x);
2524 ///
2525 real sinhl(real x);
2526
2527 ///
2528 pure double tanh(double x);
2529 ///
2530 pure float tanhf(float x);
2531 ///
2532 pure real tanhl(real x);
2533
2534 ///
2535 double exp(double x);
2536 ///
2537 float expf(float x);
2538 ///
2539 real expl(real x);
2540
2541 ///
2542 double exp2(double x);
2543 ///
2544 float exp2f(float x);
2545
2546 ///
2547 double expm1(double x);
2548 ///
2549 float expm1f(float x);
2550 ///
2551 real expm1l(real x) { return expm1(cast(double) x); }
2552
2553 ///
2554 pure double frexp(double value, int* exp);
2555 ///
2556 pure float frexpf(float value, int* exp);
2557
2558 ///
2559 int ilogb(double x);
2560 ///
2561 int ilogbf(float x);
2562
2563 ///
2564 double ldexp(double x, int exp);
2565 ///
2566 float ldexpf(float x, int exp);
2567
2568 ///
2569 double log(double x);
2570 ///
2571 float logf(float x);
2572 /// NetBSD has no logl. It is just alias log(double)
2573 real logl(real x)
2574 {
2575 if (x<0) return real.nan;
2576 if (x==0) return -real.infinity;
2577 if (isnan(x) || isinf(x)) return x;
2578 real rs = 0;
2579 if (x>double.max)
2580 {
2581 immutable MAX = log(double.max);
2582 for (; x>double.max; x /= double.max)
2583 rs += MAX;
2584 }
2585 else if (x<double.min_normal)
2586 {
2587 immutable MIN = log(double.min_normal);
2588 for (; x<double.min_normal; x /= double.min_normal)
2589 rs += MIN;
2590 }
2591 rs += log(x);
2592 return rs;
2593 }
2594
2595 ///
2596 double log10(double x);
2597 ///
2598 float log10f(float x);
2599 ///NetBSD has no log10l. It is just alias log(double)
2600 real log10l(real x)
2601 {
2602 if (x<0) return real.nan;
2603 if (x==0) return -real.infinity;
2604 if (isnan(x) || isinf(x)) return x;
2605
2606 real rs = 0;
2607 if (x>double.max)
2608 {
2609 immutable MAX = log10(double.max);
2610 for (; x>double.max; x /= double.max)
2611 rs += MAX;
2612 }
2613 else if (x<double.min_normal)
2614 {
2615 immutable MIN = log10(double.min_normal);
2616 for (; x<double.min_normal; x /= double.min_normal)
2617 rs += MIN;
2618 }
2619 rs += log10(x);
2620 return rs;
2621 }
2622
2623
2624 ///
2625 double log1p(double x);
2626 ///
2627 float log1pf(float x);
2628 ///
2629 extern(D) real log1pl(real x) { return log1p(cast(double) x); }
2630
2631 private enum real ONE_LN2 = 1 / 0x1.62e42fefa39ef358p-1L;
2632 ///
2633 extern(D) double log2(double x) { return log(x) * ONE_LN2; }
2634 ///
2635 extern(D) float log2f(float x) { return logf(x) * ONE_LN2; }
2636 ///
2637 real log2l(real x) { return logl(x) * ONE_LN2; }
2638
2639 ///
2640 double logb(double x);
2641 ///
2642 float logbf(float x);
2643
2644 ///
2645 pure double modf(double value, double* iptr);
2646 ///
2647 pure float modff(float value, float* iptr);
2648
2649 ///
2650 double scalbn(double x, int n);
2651 ///
2652 float scalbnf(float x, int n);
2653
2654 ///
2655 double scalbln(double x, c_long n);
2656 ///
2657 float scalblnf(float x, c_long n);
2658
2659 ///
2660 pure double cbrt(double x);
2661 ///
2662 pure float cbrtf(float x);
2663 ///
2664 pure real cbrtl(real x);
2665
2666 ///
2667 pure double fabs(double x);
2668 ///
2669 pure float fabsf(float x);
2670
2671 ///
2672 double hypot(double x, double y);
2673 ///
2674 float hypotf(float x, float y);
2675
2676 ///
2677 double pow(double x, double y);
2678 ///
2679 float powf(float x, float y);
2680 ///
2681 real powl(real x, real y);
2682
2683 ///
2684 double sqrt(double x);
2685 ///
2686 float sqrtf(float x);
2687
2688 ///
2689 pure double erf(double x);
2690 ///
2691 pure float erff(float x);
2692 ///
2693 extern(D) pure real erfl(real x) { return erf(cast(double) x); }
2694
2695 ///
2696 double erfc(double x);
2697 ///
2698 float erfcf(float x);
2699 ///
2700 real erfcl(real x) { return erfc(cast(double) x); }
2701
2702 ///
2703 double lgamma(double x);
2704 ///
2705 float lgammaf(float x);
2706 ///
2707 real lgammal(real x){ return lgamma(x); }
2708
2709 ///
2710 double tgamma(double x);
2711 ///
2712 float tgammaf(float x);
2713 ///
2714 real tgammal(real x){ return tgamma(cast(double) x); }
2715
2716 ///
2717 pure double ceil(double x);
2718 ///
2719 pure float ceilf(float x);
2720
2721 ///
2722 pure double floor(double x);
2723 ///
2724 pure float floorf(float x);
2725
2726 ///
2727 pure double nearbyint(double x);
2728 ///
2729 pure float nearbyintf(float x);
2730
2731 ///
2732 pure double rint(double x);
2733 ///
2734 pure float rintf(float x);
2735
2736 ///
2737 c_long lrint(double x);
2738 ///
2739 c_long lrintf(float x);
2740
2741 ///
2742 long llrint(double x);
2743 ///
2744 long llrintf(float x);
2745 ///
2746 extern(D) long llrintl(real x) { return cast(long)rintl(x); }
2747
2748 ///
2749 pure double round(double x);
2750 ///
2751 pure float roundf(float x);
2752
2753 ///
2754 c_long lround(double x);
2755 ///
2756 c_long lroundf(float x);
2757
2758 ///
2759 long llround(double x);
2760 ///
2761 long llroundf(float x);
2762
2763 ///
2764 pure double trunc(double x);
2765 ///
2766 pure float truncf(float x);
2767
2768 ///
2769 double fmod(double x, double y);
2770 ///
2771 float fmodf(float x, float y);
2772
2773 ///
2774 double remainder(double x, double y);
2775 ///
2776 float remainderf(float x, float y);
2777
2778 ///
2779 double remquo(double x, double y, int* quo);
2780 ///
2781 float remquof(float x, float y, int* quo);
2782
2783 ///
2784 pure double copysign(double x, double y);
2785 ///
2786 pure float copysignf(float x, float y);
2787
2788 ///
2789 double nextafter(double x, double y);
2790 ///
2791 float nextafterf(float x, float y);
2792
2793 ///
2794 double nexttoward(double x, real y);
2795 ///
2796 float nexttowardf(float x, real y);
2797
2798 ///
2799 double fdim(double x, double y);
2800 ///
2801 float fdimf(float x, float y);
2802
2803 ///
2804 pure double fmax(double x, double y);
2805 ///
2806 pure float fmaxf(float x, float y);
2807
2808 ///
2809 pure double fmin(double x, double y);
2810 ///
2811 pure float fminf(float x, float y);
2812
2813 ///
2814 pure double fma(double x, double y, double z);
2815 ///
2816 pure float fmaf(float x, float y, float z);
2817 }
2818 else version (OpenBSD)
2819 {
2820 ///
2821 double acos(double x);
2822 ///
2823 double asin(double x);
2824 ///
2825 pure double atan(double x);
2826 ///
2827 double atan2(double, double);
2828 ///
2829 pure double cos(double x);
2830 ///
2831 pure double sin(double x);
2832 ///
2833 pure double tan(double x);
2834 ///
2835 double cosh(double x);
2836 ///
2837 double sinh(double x);
2838 ///
2839 pure double tanh(double x);
2840 ///
2841 double exp(double x);
2842 ///
2843 pure double frexp(double, int *exp);
2844 ///
2845 double ldexp(double, int exp);
2846 ///
2847 double log(double x);
2848 ///
2849 double log10(double x);
2850 ///
2851 pure double modf(double x, double *iptr);
2852 ///
2853 double pow(double x, double y);
2854 ///
2855 double sqrt(double x);
2856 ///
2857 pure double ceil(double x);
2858 ///
2859 pure double fabs(double x);
2860 ///
2861 pure double floor(double x);
2862 ///
2863 double fmod(double x, double);
2864 ///
2865 double acosh(double x);
2866 ///
2867 pure double asinh(double x);
2868 ///
2869 double atanh(double x);
2870 ///
2871 double exp2(double x);
2872 ///
2873 double expm1(double x);
2874 ///
2875 int ilogb(double x);
2876 ///
2877 double log1p(double x);
2878 ///
2879 double log2(double x);
2880 ///
2881 double logb(double x);
2882 ///
2883 double scalbn(double x, int n);
2884 ///
2885 double scalbln(double x, c_long n);
2886 ///
2887 pure double cbrt(double x);
2888 ///
2889 double hypot(double x, double y);
2890 ///
2891 pure double erf(double x);
2892 ///
2893 double erfc(double x);
2894 ///
2895 double lgamma(double x);
2896 ///
2897 double tgamma(double x);
2898 ///
2899 pure double nearbyint(double x);
2900 ///
2901 pure double rint(double x);
2902 ///
2903 c_long lrint(double x);
2904 ///
2905 long llrint(double x);
2906 ///
2907 pure double round(double x);
2908 ///
2909 c_long lround(double x);
2910 ///
2911 long llround(double x);
2912 ///
2913 pure double trunc(double x);
2914 ///
2915 double remainder(double x , double y);
2916 ///
2917 double remquo(double x, double y, int * quo);
2918 ///
2919 pure double copysign(double x, double y);
2920 ///
2921 pure double nan(const char *);
2922 ///
2923 double nextafter(double x, double y);
2924 ///
2925 double nexttoward(double x, real y);
2926 ///
2927 double fdim(double x, double y);
2928 ///
2929 pure double fmax(double x, double y);
2930 ///
2931 pure double fmin(double x, double y);
2932 ///
2933 pure double fma(double x, double y, double z);
2934 ///
2935 double j0(double x);
2936 ///
2937 double j1(double x);
2938 ///
2939 double jn(int, double);
2940 ///
2941 double y0(double x);
2942 ///
2943 double y1(double x);
2944 ///
2945 double yn(int, double);
2946 ///
2947 double gamma(double x);
2948 ///
2949 double scalb(double x, double y);
2950 ///
2951 double drem(double x, double y);
2952 ///
2953 int finite(double x);
2954 ///
2955 double gamma_r(double x, int *);
2956 ///
2957 double lgamma_r(double x, int *);
2958 ///
2959 double significand(double x);
2960
2961 ///
2962 float acosf(float x);
2963 ///
2964 float asinf(float x);
2965 ///
2966 pure float atanf(float x);
2967 ///
2968 float atan2f(float x, float y);
2969 ///
2970 pure float cosf(float x);
2971 ///
2972 pure float sinf(float x);
2973 ///
2974 pure float tanf(float x);
2975 ///
2976 float acoshf(float x);
2977 ///
2978 pure float asinhf(float x);
2979 ///
2980 float atanhf(float x);
2981 ///
2982 float coshf(float x);
2983 ///
2984 float sinhf(float x);
2985 ///
2986 pure float tanhf(float x);
2987 ///
2988 float expf(float x);
2989 ///
2990 float exp2f(float x);
2991 ///
2992 float expm1f(float x);
2993 ///
2994 pure float frexpf(float x, int *exp);
2995 ///
2996 int ilogbf(float x);
2997 ///
2998 float ldexpf(float x, int exp);
2999 ///
3000 float logf(float x);
3001 ///
3002 float log10f(float x);
3003 ///
3004 float log1pf(float x);
3005 ///
3006 float log2f(float x);
3007 ///
3008 float logbf(float x);
3009 ///
3010 pure float modff(float x, float *iptr);
3011 ///
3012 float scalbnf(float x, int y);
3013 ///
3014 float scalblnf(float x, c_long y);
3015 ///
3016 pure float cbrtf(float x);
3017 ///
3018 pure float fabsf(float x);
3019 ///
3020 float hypotf(float x, float y);
3021 ///
3022 float powf(float x, float y);
3023 ///
3024 float sqrtf(float x);
3025 ///
3026 pure float erff(float x);
3027 ///
3028 float erfcf(float x);
3029 ///
3030 float lgammaf(float x);
3031 ///
3032 float tgammaf(float x);
3033 ///
3034 pure float ceilf(float x);
3035 ///
3036 pure float floorf(float x);
3037 ///
3038 pure float nearbyintf(float x);
3039 ///
3040 pure float rintf(float x);
3041 ///
3042 c_long lrintf(float x);
3043 ///
3044 long llrintf(float x);
3045 ///
3046 pure float roundf(float x);
3047 ///
3048 c_long lroundf(float x);
3049 ///
3050 long llroundf(float x);
3051 ///
3052 pure float truncf(float x);
3053 ///
3054 pure float fmodf(float x, float y);
3055 ///
3056 float remainderf(float x, float y);
3057 ///
3058 float remquof(float x, float y, int *iptr);
3059 ///
3060 pure float copysignf(float x, float y);
3061 ///
3062 pure float nanf(const char *);
3063 ///
3064 float nextafterf(float x, float y);
3065 ///
3066 float nexttowardf(float x, real y);
3067 ///
3068 float fdimf(float x, float y);
3069 ///
3070 pure float fmaxf(float x, float y);
3071 ///
3072 pure float fminf(float x, float y);
3073 ///
3074 pure float fmaf(float x, float y, float z);
3075 ///
3076 float j0f(float x);
3077 ///
3078 float j1f(float x);
3079 ///
3080 float jnf(int, float);
3081 ///
3082 float scalbf(float x, float);
3083 ///
3084 float y0f(float x);
3085 ///
3086 float y1f(float x);
3087 ///
3088 float ynf(int, float);
3089 ///
3090 float gammaf(float x);
3091 ///
3092 float dremf(float x, float);
3093 ///
3094 pure int finitef(float x);
3095 ///
3096 pure int isinff(float x);
3097 ///
3098 pure int isnanf(float x);
3099 ///
3100 float gammaf_r(float x, int *);
3101 ///
3102 float lgammaf_r(float x, int *);
3103 ///
3104 float significandf(float x);
3105 ///
3106
3107 ///
3108 pure real acosl(real x);
3109 ///
3110 pure real asinl(real x);
3111 ///
3112 pure real atanl(real x);
3113 ///
3114 real atan2l(real y, real x);
3115 ///
3116 pure real cosl(real x);
3117 ///
3118 pure real sinl(real x);
3119 ///
3120 pure real tanl(real x);
3121 ///
3122 real acoshl(real x);
3123 ///
3124 pure real asinhl(real x);
3125 ///
3126 real atanhl(real x);
3127 ///
3128 real coshl(real x);
3129 ///
3130 real sinhl(real x);
3131 ///
3132 pure real tanhl(real x);
3133 ///
3134 real expl(real x);
3135 ///
3136 real exp2l(real x);
3137 ///
3138 real expm1l(real x);
3139 ///
3140 pure real frexpl(real x, int *exp);
3141 ///
3142 int ilogbl(real x);
3143 ///
3144 real ldexpl(real x, int exp);
3145 ///
3146 real logl(real x);
3147 ///
3148 real log10l(real x);
3149 ///
3150 real log1pl(real x);
3151 ///
3152 real log2l(real x);
3153 ///
3154 real logbl(real x);
3155 ///
3156 pure real modfl(real x, real *iptr);
3157 ///
3158 real scalbnl(real x, int y);
3159 ///
3160 real scalblnl(real x, c_long y);
3161 ///
3162 pure real cbrtl(real x);
3163 ///
3164 pure real fabsl(real x);
3165 ///
3166 real hypotl(real x, real y);
3167 ///
3168 real powl(real x, real y);
3169 ///
3170 real sqrtl(real x);
3171 ///
3172 pure real erfl(real x);
3173 ///
3174 real erfcl(real x);
3175 ///
3176 real lgammal(real x);
3177 ///
3178 real tgammal(real x);
3179 ///
3180 pure real ceill(real x);
3181 ///
3182 pure real floorl(real x);
3183 ///
3184 pure real nearbyintl(real x);
3185 ///
3186 pure real rintl(real x);
3187 ///
3188 c_long lrintl(real x);
3189 ///
3190 long llrintl(real x);
3191 ///
3192 pure real roundl(real x);
3193 ///
3194 c_long lroundl(real x);
3195 ///
3196 long llroundl(real x);
3197 ///
3198 pure real truncl(real x);
3199 ///
3200 pure real fmodl(real x, real);
3201 ///
3202 pure real remainderl(real x, real);
3203 ///
3204 pure real remquol(real x, real y, int *iptr);
3205 ///
3206 pure real copysignl(real x, real y);
3207 ///
3208 pure real nanl(const char *);
3209 ///
3210 real nextafterl(real x, real y);
3211 ///
3212 real nexttowardl(real x, real y);
3213 ///
3214 real fdiml(real x, real y);
3215 ///
3216 pure real fmaxl(real x, real y);
3217 ///
3218 pure real fminl(real x, real y);
3219 ///
3220 pure real fmal(real x, real, real);
3221 }
3222 else version (DragonFlyBSD)
3223 {
3224 /* double */
3225 double acos(double x);
3226 double asin(double x);
3227 pure double atan(double x);
3228 double atan2(double, double);
3229 pure double cos(double x);
3230 pure double sin(double x);
3231 pure double tan(double x);
3232
3233 double cosh(double x);
3234 double sinh(double x);
3235 pure double tanh(double x);
3236
3237 double exp(double x);
3238 pure double frexp(double, int *exp);
3239 double ldexp(double, int exp);
3240 double log(double x);
3241 double log10(double x);
3242 pure double modf(double x, double *iptr);
3243
3244 double pow(double x, double y);
3245 double sqrt(double x);
3246
3247 pure double ceil(double x);
3248 pure double fabs(double x);
3249 pure double floor(double x);
3250 double fmod(double x, double);
3251
3252 double acosh(double x);
3253 pure double asinh(double x);
3254 double atanh(double x);
3255
3256 double exp2(double x);
3257 double expm1(double x);
3258 int ilogb(double x);
3259 double log1p(double x);
3260 double log2(double x);
3261 double logb(double x);
3262 double scalbn(double x, int n);
3263 double scalbln(double x, c_long n);
3264
3265 pure double cbrt(double x);
3266 double hypot(double x, double y);
3267
3268 pure double erf(double x);
3269 double erfc(double x);
3270 double lgamma(double x);
3271 double tgamma(double x);
3272
3273 pure double nearbyint(double x);
3274 pure double rint(double x);
3275 c_long lrint(double x);
3276 long llrint(double x);
3277 pure double round(double x);
3278 c_long lround(double x);
3279 long llround(double x);
3280 pure double trunc(double x);
3281
3282 double remainder(double x , double y);
3283 double remquo(double x, double y, int * quo);
3284
3285 pure double copysign(double x, double y);
3286 pure double nan(const char *);
3287 double nextafter(double x, double y);
3288 double nexttoward(double x, real y);
3289
3290 double fdim(double x, double y);
3291 pure double fmax(double x, double y);
3292 pure double fmin(double x, double y);
3293
3294 pure double fma(double x, double y, double z);
3295
3296 double j0(double x);
3297 double j1(double x);
3298 double jn(int, double);
3299 double y0(double x);
3300 double y1(double x);
3301 double yn(int, double);
3302
3303 double gamma(double x);
3304 double scalb(double x, double y);
3305
3306 double drem(double x, double y);
3307 int finite(double x);
3308 double gamma_r(double x, int *);
3309 double lgamma_r(double x, int *);
3310
3311 double significand(double x);
3312
3313 /* float */
3314 float acosf(float x);
3315 float asinf(float x);
3316 pure float atanf(float x);
3317 float atan2f(float x, float y);
3318 pure float cosf(float x);
3319 pure float sinf(float x);
3320 pure float tanf(float x);
3321
3322 float acoshf(float x);
3323 pure float asinhf(float x);
3324 float atanhf(float x);
3325 float coshf(float x);
3326 float sinhf(float x);
3327 pure float tanhf(float x);
3328
3329 float expf(float x);
3330 float exp2f(float x);
3331 float expm1f(float x);
3332 pure float frexpf(float x, int *exp);
3333 int ilogbf(float x);
3334 float ldexpf(float x, int exp);
3335 float logf(float x);
3336 float log10f(float x);
3337 float log1pf(float x);
3338 float log2f(float x);
3339 float logbf(float x);
3340 pure float modff(float x, float *iptr);
3341 float scalbnf(float x, int y);
3342 float scalblnf(float x, c_long y);
3343
3344 pure float cbrtf(float x);
3345 pure float fabsf(float x);
3346 float hypotf(float x, float y);
3347 float powf(float x, float y);
3348 float sqrtf(float x);
3349
3350 pure float erff(float x);
3351 float erfcf(float x);
3352 float lgammaf(float x);
3353 float tgammaf(float x);
3354
3355 pure float ceilf(float x);
3356 pure float floorf(float x);
3357 pure float nearbyintf(float x);
3358 pure float rintf(float x);
3359 c_long lrintf(float x);
3360 long llrintf(float x);
3361 pure float roundf(float x);
3362 c_long lroundf(float x);
3363 long llroundf(float x);
3364 pure float truncf(float x);
3365
3366 pure float fmodf(float x, float y);
3367 float remainderf(float x, float y);
3368 float remquof(float x, float y, int *iptr);
3369
3370 pure float copysignf(float x, float y);
3371 pure float nanf(const char *);
3372 float nextafterf(float x, float y);
3373 float nexttowardf(float x, real y);
3374
3375 float fdimf(float x, float y);
3376 pure float fmaxf(float x, float y);
3377 pure float fminf(float x, float y);
3378
3379 pure float fmaf(float x, float y, float z);
3380
3381 float j0f(float x);
3382 float j1f(float x);
3383 float jnf(int, float);
3384 float scalbf(float x, float);
3385 float y0f(float x);
3386 float y1f(float x);
3387 float ynf(int, float);
3388 float gammaf(float x);
3389 float dremf(float x, float);
3390 pure int finitef(float x);
3391 pure int isinff(float x);
3392 pure int isnanf(float x);
3393
3394 float gammaf_r(float x, int *);
3395 float lgammaf_r(float x, int *);
3396 float significandf(float x);
3397
3398 /* real */
3399 pure real acosl(real x);
3400 pure real asinl(real x);
3401 pure real atanl(real x);
3402 real atan2l(real y, real x);
3403 pure real cosl(real x);
3404 pure real sinl(real x);
3405 pure real tanl(real x);
3406
3407 real acoshl(real x);
3408 pure real asinhl(real x);
3409 real atanhl(real x);
3410 real coshl(real x);
3411 real sinhl(real x);
3412 pure real tanhl(real x);
3413
3414 real expl(real x);
3415 real exp2l(real x);
3416 real expm1l(real x);
3417 pure real frexpl(real x, int *exp);
3418 int ilogbl(real x);
3419 real ldexpl(real x, int exp);
3420 real logl(real x);
3421 real log10l(real x);
3422 real log1pl(real x);
3423 real log2l(real x);
3424 real logbl(real x);
3425 pure real modfl(real x, real *iptr);
3426 real scalbnl(real x, int y);
3427 real scalblnl(real x, c_long y);
3428
3429 pure real cbrtl(real x);
3430 pure real fabsl(real x);
3431 real hypotl(real x, real y);
3432 real powl(real x, real y);
3433 real sqrtl(real x);
3434
3435 pure real erfl(real x);
3436 real erfcl(real x);
3437 real lgammal(real x);
3438 real tgammal(real x);
3439
3440 pure real ceill(real x);
3441 pure real floorl(real x);
3442 pure real nearbyintl(real x);
3443 pure real rintl(real x);
3444 c_long lrintl(real x);
3445 long llrintl(real x);
3446 pure real roundl(real x);
3447 c_long lroundl(real x);
3448 long llroundl(real x);
3449 pure real truncl(real x);
3450
3451 pure real fmodl(real x, real);
3452 pure real remainderl(real x, real);
3453 pure real remquol(real x, real y, int *iptr);
3454
3455 pure real copysignl(real x, real y);
3456 pure real nanl(const char *);
3457 real nextafterl(real x, real y);
3458 real nexttowardl(real x, real y);
3459
3460 real fdiml(real x, real y);
3461 pure real fmaxl(real x, real y);
3462 pure real fminl(real x, real y);
3463
3464 pure real fmal(real x, real, real);
3465 }
3466 else version (CRuntime_Bionic)
3467 {
3468 ///
3469 double acos(double x);
3470 ///
3471 float acosf(float x);
3472 /// Added since Lollipop
3473 real acosl(real x);
3474
3475 ///
3476 double asin(double x);
3477 ///
3478 float asinf(float x);
3479 /// Added since Lollipop
3480 real asinl(real x);
3481
3482 ///
3483 pure double atan(double x);
3484 ///
3485 pure float atanf(float x);
3486 /// Added since Lollipop
3487 pure real atanl(real x);
3488
3489 ///
3490 double atan2(double y, double x);
3491 ///
3492 float atan2f(float y, float x);
3493 /// Added since Lollipop
3494 real atan2l(real y, real x);
3495
3496 ///
3497 pure double cos(double x);
3498 ///
3499 pure float cosf(float x);
3500 ///
3501 pure real cosl(real x);
3502
3503 ///
3504 pure double sin(double x);
3505 ///
3506 pure float sinf(float x);
3507 /// Added since Lollipop
3508 pure real sinl(real x);
3509
3510 ///
3511 pure double tan(double x);
3512 ///
3513 pure float tanf(float x);
3514 /// Added since Lollipop
3515 pure real tanl(real x);
3516
3517 ///
3518 double acosh(double x);
3519 ///
3520 float acoshf(float x);
3521 /// Added since Lollipop
3522 real acoshl(real x);
3523
3524 ///
3525 pure double asinh(double x);
3526 ///
3527 pure float asinhf(float x);
3528 /// Added since Lollipop
3529 pure real asinhl(real x);
3530
3531 ///
3532 double atanh(double x);
3533 ///
3534 float atanhf(float x);
3535 /// Added since Lollipop
3536 real atanhl(real x);
3537
3538 ///
3539 double cosh(double x);
3540 ///
3541 float coshf(float x);
3542 /// Added since Lollipop
3543 real coshl(real x);
3544
3545 ///
3546 double sinh(double x);
3547 ///
3548 float sinhf(float x);
3549 /// Added since Lollipop
3550 real sinhl(real x);
3551
3552 ///
3553 pure double tanh(double x);
3554 ///
3555 pure float tanhf(float x);
3556 /// Added since Lollipop
3557 pure real tanhl(real x);
3558
3559 ///
3560 double exp(double x);
3561 ///
3562 float expf(float x);
3563 ///
3564 real expl(real x);
3565
3566 ///
3567 double exp2(double x);
3568 ///
3569 float exp2f(float x);
3570 /// Added since Lollipop
3571 real exp2l(real x);
3572
3573 ///
3574 double expm1(double x);
3575 ///
3576 float expm1f(float x);
3577 /// Added since Lollipop
3578 real expm1l(real x);
3579
3580 ///
3581 pure double frexp(double value, int* exp);
3582 ///
3583 pure float frexpf(float value, int* exp);
3584 /// Added since Lollipop
3585 pure real frexpl(real value, int* exp);
3586
3587 ///
3588 int ilogb(double x);
3589 ///
3590 int ilogbf(float x);
3591 ///
3592 int ilogbl(real x);
3593
3594 ///
3595 double ldexp(double x, int exp);
3596 ///
3597 float ldexpf(float x, int exp);
3598 ///
3599 real ldexpl(real x, int exp);
3600
3601 ///
3602 double log(double x);
3603 ///
3604 float logf(float x);
3605 /// Added since Lollipop
3606 real logl(real x);
3607
3608 ///
3609 double log10(double x);
3610 ///
3611 float log10f(float x);
3612 /// Added since Lollipop
3613 real log10l(real x);
3614
3615 ///
3616 double log1p(double x);
3617 ///
3618 float log1pf(float x);
3619 /// Added since Lollipop
3620 real log1pl(real x);
3621
3622 ///
3623 double log2(double x);
3624 ///
3625 float log2f(float x);
3626 ///
3627 real log2l(real x);
3628
3629 ///
3630 double logb(double x);
3631 ///
3632 float logbf(float x);
3633 ///
3634 real logbl(real x);
3635
3636 ///
3637 pure double modf(double value, double* iptr);
3638 ///
3639 pure float modff(float value, float* iptr);
3640 /// Added since Lollipop
3641 pure real modfl(real value, real *iptr);
3642
3643 ///
3644 double scalbn(double x, int n);
3645 ///
3646 float scalbnf(float x, int n);
3647 ///
3648 real scalbnl(real x, int n);
3649
3650 ///
3651 double scalbln(double x, c_long n);
3652 ///
3653 float scalblnf(float x, c_long n);
3654 ///
3655 real scalblnl(real x, c_long n);
3656
3657 ///
3658 pure double cbrt(double x);
3659 ///
3660 pure float cbrtf(float x);
3661 /// Added since Lollipop
3662 pure real cbrtl(real x);
3663
3664 ///
3665 pure double fabs(double x);
3666 ///
3667 pure float fabsf(float x);
3668 ///
3669 pure real fabsl(real x);
3670
3671 ///
3672 double hypot(double x, double y);
3673 ///
3674 float hypotf(float x, float y);
3675 /// Added since Lollipop
3676 real hypotl(real x, real y);
3677
3678 ///
3679 double pow(double x, double y);
3680 ///
3681 float powf(float x, float y);
3682 /// Added since Lollipop
3683 real powl(real x, real y);
3684
3685 ///
3686 double sqrt(double x);
3687 ///
3688 float sqrtf(float x);
3689 /// Added since Lollipop
3690 real sqrtl(real x);
3691
3692 ///
3693 pure double erf(double x);
3694 ///
3695 pure float erff(float x);
3696 /// Added since Lollipop
3697 pure real erfl(real x);
3698
3699 ///
3700 double erfc(double x);
3701 ///
3702 float erfcf(float x);
3703 /// Added since Lollipop
3704 real erfcl(real x);
3705
3706 ///
3707 double lgamma(double x);
3708 ///
3709 float lgammaf(float x);
3710 /// Added since Lollipop
3711 real lgammal(real x);
3712
3713 ///
3714 double tgamma(double x);
3715 ///
3716 float tgammaf(float x);
3717 /// Added since Lollipop
3718 real tgammal(real x);
3719
3720 ///
3721 pure double ceil(double x);
3722 ///
3723 pure float ceilf(float x);
3724 ///
3725 pure real ceill(real x);
3726
3727 ///
3728 pure double floor(double x);
3729 ///
3730 pure float floorf(float x);
3731 ///
3732 pure real floorl(real x);
3733
3734 ///
3735 pure double nearbyint(double x);
3736 ///
3737 pure float nearbyintf(float x);
3738 /// Added since Lollipop
3739 pure real nearbyintl(real x);
3740
3741 ///
3742 pure double rint(double x);
3743 ///
3744 pure float rintf(float x);
3745 /// Added since Lollipop
3746 pure real rintl(real x);
3747
3748 ///
3749 c_long lrint(double x);
3750 ///
3751 c_long lrintf(float x);
3752 /// Added since Lollipop
3753 c_long lrintl(real x);
3754
3755 ///
3756 long llrint(double x);
3757 ///
3758 long llrintf(float x);
3759 /// Added since Lollipop
3760 long llrintl(real x);
3761
3762 ///
3763 pure double round(double x);
3764 ///
3765 pure float roundf(float x);
3766 ///
3767 pure real roundl(real x);
3768
3769 ///
3770 c_long lround(double x);
3771 ///
3772 c_long lroundf(float x);
3773 ///
3774 c_long lroundl(real x);
3775
3776 ///
3777 long llround(double x);
3778 ///
3779 long llroundf(float x);
3780 ///
3781 long llroundl(real x);
3782
3783 ///
3784 pure double trunc(double x);
3785 ///
3786 pure float truncf(float x);
3787 ///
3788 pure real truncl(real x);
3789
3790 ///
3791 double fmod(double x, double y);
3792 ///
3793 float fmodf(float x, float y);
3794 /// Added since Lollipop
3795 real fmodl(real x, real y);
3796
3797 ///
3798 double remainder(double x, double y);
3799 ///
3800 float remainderf(float x, float y);
3801 /// Added since Lollipop
3802 real remainderl(real x, real y);
3803
3804 ///
3805 double remquo(double x, double y, int* quo);
3806 ///
3807 float remquof(float x, float y, int* quo);
3808 /// Added since Lollipop
3809 real remquol(real x, real y, int* quo);
3810
3811 ///
3812 pure double copysign(double x, double y);
3813 ///
3814 pure float copysignf(float x, float y);
3815 ///
3816 pure real copysignl(real x, real y);
3817
3818 ///
3819 pure double nan(char* tagp);
3820 ///
3821 pure float nanf(char* tagp);
3822 ///
3823 pure real nanl(char* tagp);
3824
3825 ///
3826 double nextafter(double x, double y);
3827 ///
3828 float nextafterf(float x, float y);
3829 /// Added since Lollipop
3830 real nextafterl(real x, real y);
3831
3832 ///
3833 double nexttoward(double x, real y);
3834 ///
3835 float nexttowardf(float x, real y);
3836 ///
3837 real nexttowardl(real x, real y);
3838
3839 ///
3840 double fdim(double x, double y);
3841 ///
3842 float fdimf(float x, float y);
3843 ///
3844 real fdiml(real x, real y);
3845
3846 ///
3847 pure double fmax(double x, double y);
3848 ///
3849 pure float fmaxf(float x, float y);
3850 ///
3851 pure real fmaxl(real x, real y);
3852
3853 ///
3854 pure double fmin(double x, double y);
3855 ///
3856 pure float fminf(float x, float y);
3857 ///
3858 pure real fminl(real x, real y);
3859
3860 ///
3861 pure double fma(double x, double y, double z);
3862 ///
3863 pure float fmaf(float x, float y, float z);
3864 /// Added since Lollipop
3865 pure real fmal(real x, real y, real z);
3866 }
3867 else version (CRuntime_UClibc)
3868 {
3869 // uClibc wraps 'long double' to double, so we do the same for 'real'
3870
3871 ///
3872 double acos(double x);
3873 ///
3874 float acosf(float x);
3875 ///
3876 extern(D) real acosl(real x) { return acos(cast(double) x); }
3877
3878 ///
3879 double asin(double x);
3880 ///
3881 float asinf(float x);
3882 ///
3883 extern(D) real asinl(real x) { return asin(cast(double) x); }
3884
3885 ///
3886 pure double atan(double x);
3887 ///
3888 pure float atanf(float x);
3889 ///
3890 extern(D) pure real atanl(real x) { return atan(cast(double) x); }
3891
3892 ///
3893 double atan2(double y, double x);
3894 ///
3895 float atan2f(float y, float x);
3896 ///
3897 extern(D) real atan2l(real y, real x) { return atan2(cast(double) y, cast(double) x); }
3898
3899 ///
3900 pure double cos(double x);
3901 ///
3902 pure float cosf(float x);
3903 ///
3904 extern(D) pure real cosl(real x) { return cos(cast(double) x); }
3905
3906 ///
3907 pure double sin(double x);
3908 ///
3909 pure float sinf(float x);
3910 ///
3911 extern(D) pure real sinl(real x) { return sin(cast(double) x); }
3912
3913 ///
3914 pure double tan(double x);
3915 ///
3916 pure float tanf(float x);
3917 ///
3918 extern(D) pure real tanl(real x) { return tan(cast(double) x); }
3919
3920 ///
3921 double acosh(double x);
3922 ///
3923 float acoshf(float x);
3924 ///
3925 extern(D) real acoshl(real x) { return acosh(cast(double) x); }
3926
3927 ///
3928 pure double asinh(double x);
3929 ///
3930 pure float asinhf(float x);
3931 ///
3932 extern(D) pure real asinhl(real x) { return asinh(cast(double) x); }
3933
3934 ///
3935 double atanh(double x);
3936 ///
3937 float atanhf(float x);
3938 ///
3939 extern(D) real atanhl(real x) { return atanh(cast(double) x); }
3940
3941 ///
3942 double cosh(double x);
3943 ///
3944 float coshf(float x);
3945 ///
3946 extern(D) real coshl(real x) { return cosh(cast(double) x); }
3947
3948 ///
3949 double sinh(double x);
3950 ///
3951 float sinhf(float x);
3952 ///
3953 extern(D) real sinhl(real x) { return sinh(cast(double) x); }
3954
3955 ///
3956 double tanh(double x);
3957 ///
3958 float tanhf(float x);
3959 ///
3960 extern(D) real tanhl(real x) { return tanh(cast(double) x); }
3961
3962 ///
3963 double exp(double x);
3964 ///
3965 float expf(float x);
3966 ///
3967 extern(D) real expl(real x) { return exp(cast(double) x); }
3968
3969 ///
3970 double exp2(double x);
3971 ///
3972 float exp2f(float x);
3973 ///
3974 extern(D) real exp2l(real x) { return exp2(cast(double) x); }
3975
3976 ///
3977 double expm1(double x);
3978 ///
3979 float expm1f(float x);
3980 ///
3981 extern(D) real expm1l(real x) { return expm1(cast(double) x); }
3982
3983 ///
3984 pure double frexp(double value, int* exp);
3985 ///
3986 pure float frexpf(float value, int* exp);
3987 ///
3988 extern(D) pure real frexpl(real value, int* exp) { return frexp(cast(double) value, exp); }
3989
3990 ///
3991 int ilogb(double x);
3992 ///
3993 int ilogbf(float x);
3994 ///
3995 extern(D) int ilogbl(real x) { return ilogb(cast(double) x); }
3996
3997 ///
3998 double ldexp(double x, int exp);
3999 ///
4000 float ldexpf(float x, int exp);
4001 ///
4002 extern(D) real ldexpl(real x, int exp) { return ldexp(cast(double) x, exp); }
4003
4004 ///
4005 double log(double x);
4006 ///
4007 float logf(float x);
4008 ///
4009 extern(D) real logl(real x) { return log(cast(double) x); }
4010
4011 ///
4012 double log10(double x);
4013 ///
4014 float log10f(float x);
4015 ///
4016 extern(D) real log10l(real x) { return log10(cast(double) x); }
4017
4018 ///
4019 double log1p(double x);
4020 ///
4021 float log1pf(float x);
4022 ///
4023 extern(D) real log1pl(real x) { return log1p(cast(double) x); }
4024
4025 ///
4026 double log2(double x);
4027 ///
4028 float log2f(float x);
4029 ///
4030 extern(D) real log2l(real x) { return log2(cast(double) x); }
4031
4032 ///
4033 double logb(double x);
4034 ///
4035 float logbf(float x);
4036 ///
4037 extern(D) real logbl(real x) { return logb(cast(double) x); }
4038
4039 ///
4040 pure double modf(double value, double* iptr);
4041 ///
4042 pure float modff(float value, float* iptr);
4043 ///
4044 extern(D) pure real modfl(real value, real *iptr)
4045 {
4046 static if (double.sizeof == real.sizeof)
4047 return modf(cast(double) value, cast(double*) iptr);
4048 else
4049 {
4050 double i;
4051 double r = modf(cast(double) value, &i);
4052 *iptr = i;
4053 return r;
4054 }
4055 }
4056
4057 ///
4058 double scalbn(double x, int n);
4059 ///
4060 float scalbnf(float x, int n);
4061 ///
4062 extern(D) real scalbnl(real x, int n) { return scalbln(cast(double) x, n); }
4063
4064 ///
4065 double scalbln(double x, c_long n);
4066 ///
4067 float scalblnf(float x, c_long n);
4068 ///
4069 extern(D) real scalblnl(real x, c_long n) { return scalbln(cast(double) x, n); }
4070
4071 ///
4072 pure double cbrt(double x);
4073 ///
4074 pure float cbrtf(float x);
4075 ///
4076 extern(D) pure real cbrtl(real x) { return cbrt(cast(double) x); }
4077
4078 ///
4079 pure double fabs(double x);
4080 ///
4081 pure float fabsf(float x);
4082 ///
4083 extern(D) pure real fabsl(real x) { return fabs(cast(double) x); }
4084
4085 ///
4086 double hypot(double x, double y);
4087 ///
4088 float hypotf(float x, float y);
4089 ///
4090 extern(D) real hypotl(real x, real y) { return hypot(cast(double) x, cast(double) y); }
4091
4092 ///
4093 double pow(double x, double y);
4094 ///
4095 float powf(float x, float y);
4096 ///
4097 extern(D) real powl(real x, real y) { return pow(cast(double) x, cast(double) y); }
4098
4099 ///
4100 double sqrt(double x);
4101 ///
4102 float sqrtf(float x);
4103 ///
4104 extern(D) real sqrtl(real x) { return sqrt(cast(double) x); }
4105
4106 ///
4107 pure double erf(double x);
4108 ///
4109 pure float erff(float x);
4110 ///
4111 extern(D) pure real erfl(real x) { return erf(cast(double) x); }
4112
4113 ///
4114 double erfc(double x);
4115 ///
4116 float erfcf(float x);
4117 ///
4118 extern(D) real erfcl(real x) { return erfc(cast(double) x); }
4119
4120 ///
4121 double lgamma(double x);
4122 ///
4123 float lgammaf(float x);
4124 ///
4125 extern(D) real lgammal(real x) { return lgamma(cast(double) x); }
4126
4127 ///
4128 double tgamma(double x);
4129 ///
4130 float tgammaf(float x);
4131 ///
4132 extern(D) real tgammal(real x) { return tgamma(cast(double) x); }
4133
4134 ///
4135 pure double ceil(double x);
4136 ///
4137 pure float ceilf(float x);
4138 ///
4139 extern(D) pure real ceill(real x) { return ceil(cast(double) x); }
4140
4141 ///
4142 pure double floor(double x);
4143 ///
4144 pure float floorf(float x);
4145 ///
4146 extern(D) pure real floorl(real x) { return floor(cast(double) x); }
4147
4148 ///
4149 pure double nearbyint(double x);
4150 ///
4151 pure float nearbyintf(float x);
4152 ///
4153 extern(D) pure real nearbyintl(real x) { return nearbyint(cast(double) x); }
4154
4155 ///
4156 pure double rint(double x);
4157 ///
4158 pure float rintf(float x);
4159 ///
4160 extern(D) pure real rintl(real x) { return rint(cast(double) x); }
4161
4162 ///
4163 c_long lrint(double x);
4164 ///
4165 c_long lrintf(float x);
4166 ///
4167 extern(D) c_long lrintl(real x) { return lrint(cast(double) x); }
4168
4169 ///
4170 long llrint(double x);
4171 ///
4172 long llrintf(float x);
4173 ///
4174 extern(D) long llrintl(real x) { return llrint(cast(double) x); }
4175
4176 ///
4177 pure double round(double x);
4178 ///
4179 pure float roundf(float x);
4180 ///
4181 extern(D) pure real roundl(real x) { return round(cast(double) x); }
4182
4183 ///
4184 c_long lround(double x);
4185 ///
4186 c_long lroundf(float x);
4187 ///
4188 extern(D) c_long lroundl(real x) { return lround(cast(double) x); }
4189
4190 ///
4191 long llround(double x);
4192 ///
4193 long llroundf(float x);
4194 ///
4195 extern(D) long llroundl(real x) { return llround(cast(double) x); }
4196
4197 ///
4198 pure double trunc(double x);
4199 ///
4200 pure float truncf(float x);
4201 ///
4202 extern(D) pure real truncl(real x) { return trunc(cast(double) x); }
4203
4204 ///
4205 double fmod(double x, double y);
4206 ///
4207 float fmodf(float x, float y);
4208 ///
4209 extern(D) real fmodl(real x, real y) { return fmod(cast(double) x, cast(double) y); }
4210
4211 ///
4212 double remainder(double x, double y);
4213 ///
4214 float remainderf(float x, float y);
4215 ///
4216 extern(D) real remainderl(real x, real y) { return remainder(cast(double) x, cast(double) y); }
4217
4218 ///
4219 double remquo(double x, double y, int* quo);
4220 ///
4221 float remquof(float x, float y, int* quo);
4222 ///
4223 extern(D) real remquol(real x, real y, int* quo) { return remquo(cast(double) x, cast(double) y, quo); }
4224
4225 ///
4226 pure double copysign(double x, double y);
4227 ///
4228 pure float copysignf(float x, float y);
4229 ///
4230 extern(D) pure real copysignl(real x, real y) { return copysign(cast(double) x, cast(double) y); }
4231
4232 ///
4233 pure double nan(char* tagp);
4234 ///
4235 pure float nanf(char* tagp);
4236 ///
4237 extern(D) pure real nanl(char* tagp) { return nan(tagp); }
4238
4239 ///
4240 double nextafter(double x, double y);
4241 ///
4242 float nextafterf(float x, float y);
4243 ///
4244 extern(D) real nextafterl(real x, real y) { return nextafter(cast(double) x, cast(double) y); }
4245
4246 ///
4247 double nexttoward(double x, real y);
4248 ///
4249 float nexttowardf(float x, real y);
4250 ///
4251 extern(D) real nexttowardl(real x, real y) { return nexttoward(cast(double) x, cast(double) y); }
4252
4253 ///
4254 double fdim(double x, double y);
4255 ///
4256 float fdimf(float x, float y);
4257 ///
4258 extern(D) real fdiml(real x, real y) { return fdim(cast(double) x, cast(double) y); }
4259
4260 ///
4261 pure double fmax(double x, double y);
4262 ///
4263 pure float fmaxf(float x, float y);
4264 ///
4265 extern(D) pure real fmaxl(real x, real y) { return fmax(cast(double) x, cast(double) y); }
4266
4267 ///
4268 pure double fmin(double x, double y);
4269 ///
4270 pure float fminf(float x, float y);
4271 ///
4272 extern(D) pure real fminl(real x, real y) { return fmin(cast(double) x, cast(double) y); }
4273
4274 ///
4275 pure double fma(double x, double y, double z);
4276 ///
4277 pure float fmaf(float x, float y, float z);
4278 ///
4279 extern(D) pure real fmal(real x, real y, real z) { return fma(cast(double) x, cast(double) y, cast(double) z); }
4280 }
4281 else
4282 {
4283 ///
4284 double acos(double x);
4285 ///
4286 float acosf(float x);
4287
4288 ///
4289 double asin(double x);
4290 ///
4291 float asinf(float x);
4292
4293 ///
4294 pure double atan(double x);
4295 ///
4296 pure float atanf(float x);
4297
4298 ///
4299 double atan2(double y, double x);
4300 ///
4301 float atan2f(float y, float x);
4302
4303 ///
4304 pure double cos(double x);
4305 ///
4306 pure float cosf(float x);
4307
4308 ///
4309 pure double sin(double x);
4310 ///
4311 pure float sinf(float x);
4312
4313 ///
4314 pure double tan(double x);
4315 ///
4316 pure float tanf(float x);
4317
4318 ///
4319 double acosh(double x);
4320 ///
4321 float acoshf(float x);
4322
4323 ///
4324 pure double asinh(double x);
4325 ///
4326 pure float asinhf(float x);
4327
4328 ///
4329 double atanh(double x);
4330 ///
4331 float atanhf(float x);
4332
4333 ///
4334 double cosh(double x);
4335 ///
4336 float coshf(float x);
4337
4338 ///
4339 double sinh(double x);
4340 ///
4341 float sinhf(float x);
4342
4343 ///
4344 pure double tanh(double x);
4345 ///
4346 pure float tanhf(float x);
4347
4348 ///
4349 double exp(double x);
4350 ///
4351 float expf(float x);
4352
4353 ///
4354 double exp2(double x);
4355 ///
4356 float exp2f(float x);
4357
4358 ///
4359 double expm1(double x);
4360 ///
4361 float expm1f(float x);
4362
4363 ///
4364 pure double frexp(double value, int* exp);
4365 ///
4366 pure float frexpf(float value, int* exp);
4367
4368 ///
4369 int ilogb(double x);
4370 ///
4371 int ilogbf(float x);
4372
4373 ///
4374 double ldexp(double x, int exp);
4375 ///
4376 float ldexpf(float x, int exp);
4377
4378 ///
4379 double log(double x);
4380 ///
4381 float logf(float x);
4382
4383 ///
4384 double log10(double x);
4385 ///
4386 float log10f(float x);
4387
4388 ///
4389 double log1p(double x);
4390 ///
4391 float log1pf(float x);
4392
4393 ///
4394 double log2(double x);
4395 ///
4396 float log2f(float x);
4397
4398 ///
4399 double logb(double x);
4400 ///
4401 float logbf(float x);
4402
4403 ///
4404 pure double modf(double value, double* iptr);
4405 ///
4406 pure float modff(float value, float* iptr);
4407
4408 ///
4409 double scalbn(double x, int n);
4410 ///
4411 float scalbnf(float x, int n);
4412
4413 ///
4414 double scalbln(double x, c_long n);
4415 ///
4416 float scalblnf(float x, c_long n);
4417
4418 ///
4419 pure double cbrt(double x);
4420 ///
4421 pure float cbrtf(float x);
4422
4423 ///
4424 pure double fabs(double x);
4425
4426 ///
4427 double hypot(double x, double y);
4428 ///
4429 float hypotf(float x, float y);
4430
4431 ///
4432 double pow(double x, double y);
4433 ///
4434 float powf(float x, float y);
4435
4436 ///
4437 double sqrt(double x);
4438 ///
4439 float sqrtf(float x);
4440
4441 ///
4442 pure double erf(double x);
4443 ///
4444 pure float erff(float x);
4445
4446 ///
4447 double erfc(double x);
4448 ///
4449 float erfcf(float x);
4450
4451 ///
4452 double lgamma(double x);
4453 ///
4454 float lgammaf(float x);
4455
4456 ///
4457 double tgamma(double x);
4458 ///
4459 float tgammaf(float x);
4460
4461 ///
4462 pure double ceil(double x);
4463 ///
4464 pure float ceilf(float x);
4465
4466 ///
4467 pure double floor(double x);
4468 ///
4469 pure float floorf(float x);
4470
4471 ///
4472 pure double nearbyint(double x);
4473 ///
4474 pure float nearbyintf(float x);
4475
4476 ///
4477 pure double rint(double x);
4478 ///
4479 pure float rintf(float x);
4480
4481 ///
4482 c_long lrint(double x);
4483 ///
4484 c_long lrintf(float x);
4485
4486 ///
4487 long llrint(double x);
4488 ///
4489 long llrintf(float x);
4490
4491 ///
4492 pure double round(double x);
4493 ///
4494 pure float roundf(float x);
4495
4496 ///
4497 c_long lround(double x);
4498 ///
4499 c_long lroundf(float x);
4500
4501 ///
4502 long llround(double x);
4503 ///
4504 long llroundf(float x);
4505
4506 ///
4507 pure double trunc(double x);
4508 ///
4509 pure float truncf(float x);
4510
4511 ///
4512 double fmod(double x, double y);
4513 ///
4514 float fmodf(float x, float y);
4515
4516 ///
4517 double remainder(double x, double y);
4518 ///
4519 float remainderf(float x, float y);
4520
4521 ///
4522 double remquo(double x, double y, int* quo);
4523 ///
4524 float remquof(float x, float y, int* quo);
4525
4526 ///
4527 pure double copysign(double x, double y);
4528 ///
4529 pure float copysignf(float x, float y);
4530
4531 ///
4532 pure double nan(char* tagp);
4533 ///
4534 pure float nanf(char* tagp);
4535
4536 ///
4537 double nextafter(double x, double y);
4538 ///
4539 float nextafterf(float x, float y);
4540 ///
4541
4542 ///
4543 double fdim(double x, double y);
4544 ///
4545 float fdimf(float x, float y);
4546
4547 ///
4548 pure double fmax(double x, double y);
4549 ///
4550 pure float fmaxf(float x, float y);
4551
4552
4553 ///
4554 pure double fmin(double x, double y);
4555 ///
4556 pure float fminf(float x, float y);
4557
4558
4559 ///
4560 pure double fma(double x, double y, double z);
4561 ///
4562 pure float fmaf(float x, float y, float z);
4563
4564
4565 static if (PPCUseIEEE128) {
4566 ///
4567 real __acosieee128(real x);
4568 ///
4569 alias acosl = __acosieee128;
4570 ///
4571 real __asinieee128(real x);
4572 ///
4573 alias asinl = __asinieee128;
4574 ///
4575 pure real __atanieee128(real x);
4576 ///
4577 alias atanl = __atanieee128;
4578 ///
4579 real __atan2ieee128(real y, real x);
4580 ///
4581 alias atan2l = __atan2ieee128;
4582 ///
4583 pure real __cosieee128(real x);
4584 ///
4585 alias cosl = __cosieee128;
4586 ///
4587 pure real __sinieee128(real x);
4588 ///
4589 alias sinl = __sinieee128;
4590 ///
4591 pure real __tanieee128(real x);
4592 ///
4593 alias tanl = __tanieee128;
4594 ///
4595 real __acoshieee128(real x);
4596 ///
4597 alias acoshl = __acoshieee128;
4598 ///
4599 pure real __asinhieee128(real x);
4600 ///
4601 alias asinhl = __asinhieee128;
4602 ///
4603 real __atanhieee128(real x);
4604 ///
4605 alias atanhl = __atanhieee128;
4606 ///
4607 real __coshieee128(real x);
4608 ///
4609 alias coshl = __coshieee128;
4610 ///
4611 real __sinhieee128(real x);
4612 ///
4613 alias sinhl = __sinhieee128;
4614 ///
4615 pure real __tanhieee128(real x);
4616 ///
4617 alias tanhl = __tanhieee128;
4618 ///
4619 real __expieee128(real x);
4620 ///
4621 alias expl = __expieee128;
4622 ///
4623 real __exp2ieee128(real x);
4624 ///
4625 alias exp2l = __exp2ieee128;
4626 ///
4627 real __expm1ieee128(real x);
4628 ///
4629 alias expm1l = __expm1ieee128;
4630 ///
4631 pure real __frexpieee128(real value, int* exp);
4632 ///
4633 alias frexpl = __frexpieee128;
4634 ///
4635 int __ilogbieee128(real x);
4636 ///
4637 alias ilogbl = __ilogbieee128;
4638 ///
4639 real __ldexpieee128(real x, int exp);
4640 ///
4641 alias ldexpl = __ldexpieee128;
4642 ///
4643 real __logieee128(real x);
4644 ///
4645 alias logl = __logieee128;
4646 ///
4647 real __log10ieee128(real x);
4648 ///
4649 alias log10l = __log10ieee128;
4650 ///
4651 real __log1pieee128(real x);
4652 ///
4653 alias log1pl = __log1pieee128;
4654 ///
4655 real __log2ieee128(real x);
4656 ///
4657 alias log2l = __log2ieee128;
4658 ///
4659 real __logbieee128(real x);
4660 ///
4661 alias logbl = __logbieee128;
4662 ///
4663 pure real __modfieee128(real value, real *iptr);
4664 ///
4665 alias modfl = __modfieee128;
4666 ///
4667 real __scalbnieee128(real x, int n);
4668 ///
4669 alias scalbnl = __scalbnieee128;
4670 ///
4671 real __scalblnieee128(real x, c_long n);
4672 ///
4673 alias scalblnl = __scalblnieee128;
4674 ///
4675 pure real __cbrtieee128(real x);
4676 ///
4677 alias cbrtl = __cbrtieee128;
4678 ///
4679 pure float fabsf(float x);
4680 ///
4681 pure real __fabsieee128(real x);
4682 ///
4683 alias fabsl = __fabsieee128;
4684 ///
4685 real __hypotieee128(real x, real y);
4686 ///
4687 alias hypotl = __hypotieee128;
4688 ///
4689 real __powieee128(real x, real y);
4690 ///
4691 alias powl = __powieee128;
4692 ///
4693 real __sqrtieee128(real x);
4694 ///
4695 alias sqrtl = __sqrtieee128;
4696 ///
4697 pure real __erfieee128(real x);
4698 ///
4699 alias erfl = __erfieee128;
4700 ///
4701 real __erfcieee128(real x);
4702 ///
4703 alias erfcl = __erfcieee128;
4704 ///
4705 real __lgammaieee128(real x);
4706 ///
4707 alias lgammal = __lgammaieee128;
4708 ///
4709 real __tgammaieee128(real x);
4710 ///
4711 alias tgammal = __tgammaieee128;
4712 ///
4713 pure real __ceilieee128(real x);
4714 ///
4715 alias ceill = __ceilieee128;
4716 ///
4717 pure real __floorieee128(real x);
4718 ///
4719 alias floorl = __floorieee128;
4720 ///
4721 pure real __nearbyintieee128(real x);
4722 ///
4723 alias nearbyintl = __nearbyintieee128;
4724 ///
4725 pure real __rintieee128(real x);
4726 ///
4727 alias rintl = __rintieee128;
4728 ///
4729 c_long __lrintieee128(real x);
4730 ///
4731 alias lrintl = __lrintieee128;
4732 ///
4733 long __llrintieee128(real x);
4734 ///
4735 alias llrintl = __llrintieee128;
4736 ///
4737 pure real __roundieee128(real x);
4738 ///
4739 alias roundl = __roundieee128;
4740 ///
4741 c_long __lroundieee128(real x);
4742 ///
4743 alias lroundl = __lroundieee128;
4744 ///
4745 long __llroundieee128(real x);
4746 ///
4747 alias llroundl = __llroundieee128;
4748 ///
4749 pure real __truncieee128(real x);
4750 ///
4751 alias truncl = __truncieee128;
4752 ///
4753 real __fmodieee128(real x, real y);
4754 ///
4755 alias fmodl = __fmodieee128;
4756 ///
4757 real __remainderieee128(real x, real y);
4758 ///
4759 alias remainderl = __remainderieee128;
4760 ///
4761 real __remquoieee128(real x, real y, int* quo);
4762 ///
4763 alias remquol = __remquoieee128;
4764 ///
4765 pure real __copysignieee128(real x, real y);
4766 ///
4767 alias copysignl = __copysignieee128;
4768 ///
4769 pure real __nanieee128(char* tagp);
4770 ///
4771 alias nanl = __nanieee128;
4772 ///
4773 real __nextafterieee128(real x, real y);
4774 ///
4775 alias nextafterl = __nextafterieee128;
4776 ///
4777 double __nexttoward_to_ieee128(double x, real y);
4778 ///
4779 alias nexttoward = __nexttoward_to_ieee128;
4780 ///
4781 float __nexttowardf_to_ieee128(float x, real y);
4782 ///
4783 alias nexttowardf = __nexttowardf_to_ieee128;
4784 ///
4785 real __nexttowardieee128(real x, real y);
4786 ///
4787 alias nexttowardl = __nexttowardieee128;
4788 ///
4789 real __fdimieee128(real x, real y);
4790 ///
4791 alias fdiml = __fdimieee128;
4792 ///
4793 pure real __fmaxieee128(real x, real y);
4794 ///
4795 alias fmaxl = __fmaxieee128;
4796 ///
4797 pure real __fminieee128(real x, real y);
4798 ///
4799 alias fminl = __fminieee128;
4800 ///
4801 pure real __fmaieee128(real x, real y, real z);
4802 ///
4803 alias fmal = __fmaieee128;
4804 }
4805 else
4806 {
4807 ///
4808 real acosl(real x);
4809 ///
4810 real asinl(real x);
4811 ///
4812 pure real atanl(real x);
4813 ///
4814 real atan2l(real y, real x);
4815 ///
4816 pure real cosl(real x);
4817 ///
4818 pure real sinl(real x);
4819 ///
4820 pure real tanl(real x);
4821 ///
4822 real acoshl(real x);
4823 ///
4824 pure real asinhl(real x);
4825 ///
4826 real atanhl(real x);
4827 ///
4828 real coshl(real x);
4829 ///
4830 real sinhl(real x);
4831 ///
4832 pure real tanhl(real x);
4833 ///
4834 real expl(real x);
4835 ///
4836 real exp2l(real x);
4837 ///
4838 real expm1l(real x);
4839 ///
4840 pure real frexpl(real value, int* exp);
4841 ///
4842 int ilogbl(real x);
4843 ///
4844 real ldexpl(real x, int exp);
4845 ///
4846 real logl(real x);
4847 ///
4848 real log10l(real x);
4849 ///
4850 real log1pl(real x);
4851 ///
4852 real log2l(real x);
4853 ///
4854 real logbl(real x);
4855 ///
4856 pure real modfl(real value, real *iptr);
4857 ///
4858 real scalbnl(real x, int n);
4859 ///
4860 real scalblnl(real x, c_long n);
4861 ///
4862 pure real cbrtl(real x);
4863 version (CRuntime_Microsoft)
4864 {
4865 }
4866 else
4867 {
4868 ///
4869 pure float fabsf(float x);
4870 ///
4871 pure real fabsl(real x);
4872 }
4873 ///
4874 real hypotl(real x, real y);
4875 ///
4876 real powl(real x, real y);
4877 ///
4878 real sqrtl(real x);
4879 ///
4880 pure real erfl(real x);
4881 ///
4882 real erfcl(real x);
4883 ///
4884 real lgammal(real x);
4885 ///
4886 real tgammal(real x);
4887 ///
4888 pure real ceill(real x);
4889 ///
4890 pure real floorl(real x);
4891 ///
4892 pure real nearbyintl(real x);
4893 ///
4894 pure real rintl(real x);
4895 ///
4896 c_long lrintl(real x);
4897 ///
4898 long llrintl(real x);
4899 ///
4900 pure real roundl(real x);
4901 ///
4902 c_long lroundl(real x);
4903 ///
4904 long llroundl(real x);
4905 ///
4906 pure real truncl(real x);
4907 ///
4908 real fmodl(real x, real y);
4909 ///
4910 real remainderl(real x, real y);
4911 ///
4912 real remquol(real x, real y, int* quo);
4913 ///
4914 pure real copysignl(real x, real y);
4915 ///
4916 pure real nanl(char* tagp);
4917 ///
4918 real nextafterl(real x, real y);
4919 ///
4920 double nexttoward(double x, real y);
4921 ///
4922 float nexttowardf(float x, real y);
4923 ///
4924 real nexttowardl(real x, real y);
4925 ///
4926 real fdiml(real x, real y);
4927 ///
4928 pure real fmaxl(real x, real y);
4929 ///
4930 pure real fminl(real x, real y);
4931 ///
4932 pure real fmal(real x, real y, real z);
4933 }
4934 }