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