From e3b6c5a4f27ab5dcf4b07a6d91a4c925e968d626 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 27 Sep 2014 21:23:37 +0200 Subject: [PATCH 1/6] core.stdc.fenv: standardize version() statements Conflicts: src/core/stdc/fenv.d --- src/core/stdc/fenv.d | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/src/core/stdc/fenv.d b/src/core/stdc/fenv.d index ba77951668..14e7b0d7b8 100644 --- a/src/core/stdc/fenv.d +++ b/src/core/stdc/fenv.d @@ -27,10 +27,6 @@ version( MinGW ) version( linux ) version = GNUFP; -version( DigitalMars ) - version( Win32 ) - version = DMC_RUNTIME; - version( GNUFP ) { // https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/fpu/bits/fenv.h @@ -117,7 +113,7 @@ version( GNUFP ) static assert(0, "Unimplemented architecture"); } } -else version( DMC_RUNTIME ) +else version( CRuntime_DigitalMars ) { struct fenv_t { @@ -128,9 +124,8 @@ else version( DMC_RUNTIME ) } alias fexcept_t = int; } -else version( Windows ) +else version( CRuntime_Microsoft ) { - // MSVCRT struct fenv_t { uint ctl; @@ -234,34 +229,22 @@ enum FE_TOWARDZERO = 0xC00, /// } -version( DMC_RUNTIME ) +version( GNUFP ) { - private extern __gshared fenv_t _FE_DFL_ENV; /// - enum fenv_t* FE_DFL_ENV = &_FE_DFL_ENV; + enum FE_DFL_ENV = cast(fenv_t*)(-1); } -else version( Windows ) +else version( CRuntime_DigitalMars ) { - version( Win64 ) // requires MSVCRT >= 2013 - { - private extern __gshared fenv_t _Fenv0; - fenv_t* FE_DFL_ENV = &_Fenv0; - } - else - version( MinGW ) - /// - enum FE_DFL_ENV = cast(fenv_t*)(-1); - else - { - private immutable fenv_t _Fenv0 = {0, 0}; - /// - enum FE_DFL_ENV = &_Fenv0; - } + private extern __gshared fenv_t _FE_DFL_ENV; + /// + enum fenv_t* FE_DFL_ENV = &_FE_DFL_ENV; } -else version( linux ) +else version( CRuntime_Microsoft ) { + private immutable fenv_t _Fenv0 = {0, 0}; /// - enum FE_DFL_ENV = cast(fenv_t*)(-1); + enum FE_DFL_ENV = &_Fenv0; } else version( OSX ) { From 23c22ea4c5be386678501c665d9a837200d9921a Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 27 Sep 2014 21:27:23 +0200 Subject: [PATCH 2/6] core.stdc.fenv: all functions return an int --- src/core/stdc/fenv.d | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/stdc/fenv.d b/src/core/stdc/fenv.d index 14e7b0d7b8..c358dd41e2 100644 --- a/src/core/stdc/fenv.d +++ b/src/core/stdc/fenv.d @@ -281,9 +281,9 @@ else } /// -void feraiseexcept(int excepts); +int feraiseexcept(int excepts); /// -void feclearexcept(int excepts); +int feclearexcept(int excepts); /// int fetestexcept(int excepts); @@ -291,9 +291,9 @@ int fetestexcept(int excepts); int feholdexcept(fenv_t* envp); /// -void fegetexceptflag(fexcept_t* flagp, int excepts); +int fegetexceptflag(fexcept_t* flagp, int excepts); /// -void fesetexceptflag(in fexcept_t* flagp, int excepts); +int fesetexceptflag(in fexcept_t* flagp, int excepts); /// int fegetround(); @@ -301,8 +301,8 @@ int fegetround(); int fesetround(int round); /// -void fegetenv(fenv_t* envp); +int fegetenv(fenv_t* envp); /// -void fesetenv(in fenv_t* envp); +int fesetenv(in fenv_t* envp); /// -void feupdateenv(in fenv_t* envp); +int feupdateenv(in fenv_t* envp); From 617ce63c87f9fd72e0307e09c4006e2618d0cbf2 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 27 Sep 2014 22:01:11 +0200 Subject: [PATCH 3/6] core.stdc.fenv: add proper support for MSVCRT 12+ (VS 2013) --- src/core/stdc/fenv.d | 99 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 82 insertions(+), 17 deletions(-) diff --git a/src/core/stdc/fenv.d b/src/core/stdc/fenv.d index c358dd41e2..ba38c3adaa 100644 --- a/src/core/stdc/fenv.d +++ b/src/core/stdc/fenv.d @@ -214,19 +214,38 @@ else static assert( false, "Unsupported platform" ); } -enum +version( CRuntime_Microsoft ) { - FE_INVALID = 1, /// - FE_DENORMAL = 2, /// non-standard - FE_DIVBYZERO = 4, /// - FE_OVERFLOW = 8, /// - FE_UNDERFLOW = 0x10, /// - FE_INEXACT = 0x20, /// - FE_ALL_EXCEPT = 0x3F, /// - FE_TONEAREST = 0, /// - FE_UPWARD = 0x800, /// - FE_DOWNWARD = 0x400, /// - FE_TOWARDZERO = 0xC00, /// + enum + { + FE_INEXACT = 1, /// + FE_UNDERFLOW = 2, /// + FE_OVERFLOW = 4, /// + FE_DIVBYZERO = 8, /// + FE_INVALID = 0x10, /// + FE_ALL_EXCEPT = 0x1F, /// + FE_TONEAREST = 0, /// + FE_UPWARD = 0x100, /// + FE_DOWNWARD = 0x200, /// + FE_TOWARDZERO = 0x300, /// + } +} +else +{ + enum + { + FE_INVALID = 1, /// + FE_DENORMAL = 2, /// non-standard + FE_DIVBYZERO = 4, /// + FE_OVERFLOW = 8, /// + FE_UNDERFLOW = 0x10, /// + FE_INEXACT = 0x20, /// + FE_ALL_EXCEPT = 0x3F, /// + FE_TONEAREST = 0, /// + FE_UPWARD = 0x800, /// + FE_DOWNWARD = 0x400, /// + FE_TOWARDZERO = 0xC00, /// + } } version( GNUFP ) @@ -242,7 +261,7 @@ else version( CRuntime_DigitalMars ) } else version( CRuntime_Microsoft ) { - private immutable fenv_t _Fenv0 = {0, 0}; + private extern __gshared fenv_t _Fenv0; /// enum FE_DFL_ENV = &_Fenv0; } @@ -280,8 +299,6 @@ else static assert( false, "Unsupported platform" ); } -/// -int feraiseexcept(int excepts); /// int feclearexcept(int excepts); @@ -304,5 +321,53 @@ int fesetround(int round); int fegetenv(fenv_t* envp); /// int fesetenv(in fenv_t* envp); -/// -int feupdateenv(in fenv_t* envp); + +// MS define feraiseexcept() and feupdateenv() inline. +version( CRuntime_Microsoft ) // supported since MSVCRT 12 (VS 2013) only +{ + /// + int feraiseexcept()(int excepts) + { + struct Entry + { + int exceptVal; + double num; + double denom; + } + static __gshared immutable(Entry[5]) table = + [ // Raise exception by evaluating num / denom: + { FE_INVALID, 0.0, 0.0 }, + { FE_DIVBYZERO, 1.0, 0.0 }, + { FE_OVERFLOW, 1e+300, 1e-300 }, + { FE_UNDERFLOW, 1e-300, 1e+300 }, + { FE_INEXACT, 2.0, 3.0 } + ]; + + if ((excepts &= FE_ALL_EXCEPT) == 0) + return 0; + + // Raise the exceptions not masked: + double ans = void; + foreach (i; 0 .. table.length) + { + if ((excepts & table[i].exceptVal) != 0) + ans = table[i].num / table[i].denom; + } + + return 0; + } + + /// + int feupdateenv()(in fenv_t* envp) + { + int excepts = fetestexcept(FE_ALL_EXCEPT); + return (fesetenv(envp) != 0 || feraiseexcept(excepts) != 0 ? 1 : 0); + } +} +else +{ + /// + int feraiseexcept(int excepts); + /// + int feupdateenv(in fenv_t* envp); +} From 99888a171f6516d4c9cd9a03a6dc8b9f982ca6c6 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 27 Sep 2014 17:22:17 +0200 Subject: [PATCH 4/6] core.stdc.math: Update fpclassify() macros family for MSVCRT. Especially for MSVCRT 12+ (VS 2013). Conflicts: src/core/stdc/math.d --- src/core/stdc/math.d | 197 ++++++++++++++++++++++++------------------- 1 file changed, 110 insertions(+), 87 deletions(-) diff --git a/src/core/stdc/math.d b/src/core/stdc/math.d index f58ee87873..19343a6669 100644 --- a/src/core/stdc/math.d +++ b/src/core/stdc/math.d @@ -216,129 +216,152 @@ version( CRuntime_DigitalMars ) } } } -else version( CRuntime_Microsoft ) +else version( CRuntime_Microsoft ) // fully supported since MSVCRT 12 (VS 2013) only { - version( LDC ) - { - enum - { - FP_SUBNORMAL = -2, - FP_NORMAL = -1, - FP_ZERO = 0, - FP_INFINITE = 1, - FP_NAN = 2, - } - - private short _fdclass(float x); - private short _dclass(double x); - - private int _fdsign(float x); - private int _dsign(double x); - } - - deprecated("Please use the standard C99 functions instead.") + version( all ) // legacy stuff to be removed in the future { enum { - /// _FPCLASS_SNAN = 1, - /// _FPCLASS_QNAN = 2, - /// _FPCLASS_NINF = 4, - /// _FPCLASS_NN = 8, - /// _FPCLASS_ND = 0x10, - /// _FPCLASS_NZ = 0x20, - /// _FPCLASS_PZ = 0x40, - /// _FPCLASS_PD = 0x80, - /// _FPCLASS_PN = 0x100, - /// _FPCLASS_PINF = 0x200, } - /// + //deprecated("Please use the standard C99 function copysignf() instead.") float _copysignf(float x, float s); - /// + + //deprecated("_chgsignf(x) is a non-standard MS extension. Please consider using -x instead.") float _chgsignf(float x); - /// - int _finitef(float x); - /// - version(Win64) int _isnanf(float x); // not available in Win32? - /// - int _fpclassf(float x); - /// + version( Win64 ) // not available in 32-bit runtimes + { + //deprecated("Please use the standard C99 function isfinite() instead.") + int _finitef(float x); + + //deprecated("Please use the standard C99 function isnan() instead.") + int _isnanf(float x); + + //deprecated("Please use the standard C99 function fpclassify() instead.") + int _fpclassf(float x); + } + + //deprecated("Please use the standard C99 function copysign() instead.") double _copysign(double x, double s); - /// + + //deprecated("_chgsign(x) is a non-standard MS extension. Please consider using -x instead.") double _chgsign(double x); - /// + + //deprecated("Please use the standard C99 function isfinite() instead.") int _finite(double x); - /// + + //deprecated("Please use the standard C99 function isnan() instead.") int _isnan(double x); - /// + + //deprecated("Please use the standard C99 function fpclassify() instead.") int _fpclass(double x); } - version(LDC) + enum { - extern(D) - { - //int fpclassify(real-floating x); - int fpclassify(float x) { return _fdclass(x); } - int fpclassify(double x) { return _dclass(x); } - int fpclassify(real x) { static if (real.sizeof == double.sizeof) return _dclass(x); else assert(0); } - - //int isfinite(real-floating x); - int isfinite(float x) { return fpclassify(x) <= 0; } - int isfinite(double x) { return fpclassify(x) <= 0; } - int isfinite(real x) { return fpclassify(x) <= 0; } - - //int isinf(real-floating x); - int isinf(float x) { return fpclassify(x) == FP_INFINITE; } - int isinf(double x) { return fpclassify(x) == FP_INFINITE; } - int isinf(real x) { return fpclassify(x) == FP_INFINITE; } - - //int isnan(real-floating x); - int isnan(float x) { return fpclassify(x) == FP_NAN; } - int isnan(double x) { return fpclassify(x) == FP_NAN; } - int isnan(real x) { return fpclassify(x) == FP_NAN; } - - //int isnormal(real-floating x); - int isnormal(float x) { return fpclassify(x) == FP_NORMAL; } - int isnormal(double x) { return fpclassify(x) == FP_NORMAL; } - int isnormal(real x) { return fpclassify(x) == FP_NORMAL; } - - //int signbit(real-floating x); - int signbit(float x) { return _fdsign(x); } - int signbit(double x) { return _dsign(x); } - int signbit(real x) - { - return (real.sizeof == double.sizeof) - ? (cast(short*)&(x))[3] & 0x8000 - : (cast(short*)&(x))[4] & 0x8000; - } - } + /// + FP_SUBNORMAL = -2, + /// + FP_NORMAL = -1, + /// + FP_ZERO = 0, + /// + FP_INFINITE = 1, + /// + FP_NAN = 2, } - else + + private short _fdclass(float x); + private short _dclass(double x); + + private int _fdsign(float x); + private int _dsign(double x); + + extern(D) + { + //int fpclassify(real-floating x); + /// + int fpclassify(float x) { return _fdclass(x); } + /// + int fpclassify(double x) { return _dclass(x); } + /// + int fpclassify(real x) { - extern(D) + static if (real.sizeof == double.sizeof) + return _dclass(cast(double) x); + else + static assert(false, "fpclassify(real) not supported by MS C runtime"); + } + + //int isfinite(real-floating x); + /// + int isfinite(float x) { return fpclassify(x) <= 0; } + /// + int isfinite(double x) { return fpclassify(x) <= 0; } + /// + int isfinite(real x) { return fpclassify(x) <= 0; } + + //int isinf(real-floating x); + /// + int isinf(float x) { return fpclassify(x) == FP_INFINITE; } + /// + int isinf(double x) { return fpclassify(x) == FP_INFINITE; } + /// + int isinf(real x) { return fpclassify(x) == FP_INFINITE; } + + //int isnan(real-floating x); + version( none ) // requires MSVCRT 12+ (VS 2013) { /// - version(Win64) int isnan(float x) { return _isnanf(x); } + int isnan(float x) { return fpclassify(x) == FP_NAN; } + /// + int isnan(double x) { return fpclassify(x) == FP_NAN; } + /// + int isnan(real x) { return fpclassify(x) == FP_NAN; } + } + else // for backward compatibility with older runtimes + { /// - version(Win32) int isnan(float x) { return _isnan(x); } + int isnan(float x) { version(Win64) return _isnanf(x); else return _isnan(cast(double) x); } /// - int isnan(double x) { return _isnan(x); } + int isnan(double x) { return _isnan(x); } /// - int isnan(real x) { return _isnan(x); } + int isnan(real x) { return _isnan(cast(double) x); } } + + //int isnormal(real-floating x); + /// + int isnormal(float x) { return fpclassify(x) == FP_NORMAL; } + /// + int isnormal(double x) { return fpclassify(x) == FP_NORMAL; } + /// + int isnormal(real x) { return fpclassify(x) == FP_NORMAL; } + + //int signbit(real-floating x); + /// + int signbit(float x) { return _fdsign(x); } + /// + int signbit(double x) { return _dsign(x); } + /// + int signbit(real x) + { + static if (real.sizeof == double.sizeof) + return _dsign(cast(double) x); + else + return (cast(short*)&(x))[4] & 0x8000; } + } } else version( linux ) { From 911c8b46acc17373b42d0a487039c31927e22c09 Mon Sep 17 00:00:00 2001 From: Martin Date: Sat, 27 Sep 2014 17:35:03 +0200 Subject: [PATCH 5/6] core.stdc.math: Improve MSVCRT support, especially for VS 2013+. By implementing functions defined inline in MS math.h header (from VS 2014 CTP3) and using D wrappers for all *l functions. hypot() forwards to _hypot() to support VS <= 2013. Conflicts: src/core/stdc/math.d --- src/core/stdc/math.d | 667 ++++++++++++++++++++++++++----------------- 1 file changed, 407 insertions(+), 260 deletions(-) diff --git a/src/core/stdc/math.d b/src/core/stdc/math.d index 19343a6669..22d21b788b 100644 --- a/src/core/stdc/math.d +++ b/src/core/stdc/math.d @@ -968,267 +968,414 @@ extern (D) * internally with reduced 64-bit precision. * This also enables relaxing real to 64-bit double. */ -version( CRuntime_Microsoft ) // requires MSVCRT >= 2013 +version( CRuntime_Microsoft ) // fully supported since MSVCRT 12 (VS 2013) only { - double acos (double x); - version(Win64) float acosf(float x); - version(Win32) float acosf(float x) { return cast(float) acos(x); } - extern(D) real acosl(real x) { return acos(cast(double) x); } - - double asin (double x); - version(Win64) float asinf(float x); - version(Win32) float asinf(float x) { return cast(float) asin(x); } - extern(D) real asinl(real x) { return asin(cast(double) x); } - - double atan (double x); - version(Win64) float atanf(float x); - version(Win32) float atanf(float x) { return cast(float) atan(x); } - extern(D) real atanl(real x) { return atan(cast(double) x); } - - double atan2 (double y, double x); - version(Win64) float atan2f(float y, float x); - version(Win32) float atan2f(float y, float x) { return cast(float) atan2(y, x); } - extern(D) real atan2l(real y, real x) { return atan2(cast(double) y, cast(double) x); } - - double cos (double x); - version(Win64) float cosf(float x); - version(Win32) float cosf(float x) { return cast(float) cos(x); } - extern(D) real cosl(real x) { return cos(cast(double) x); } - - double sin (double x); - version(Win64) float sinf(float x); - version(Win32) float sinf(float x) { return cast(float) sin(x); } - extern(D) real sinl(real x) { return sin(cast(double) x); } - - double tan (double x); - version(Win64) float tanf(float x); - version(Win32) float tanf(float x) { return cast(float) tan(x); } - extern(D) real tanl(real x) { return tan(cast(double) x); } - - double acosh (double x); - float acoshf(float x); - extern(D) real acoshl(real x) { return acosh(cast(double) x); } - - double asinh (double x); - float asinhf(float x); - extern(D) real asinhl(real x) { return asinh(cast(double) x); } - - double atanh (double x); - float atanhf(float x); - extern(D) real atanhl(real x) { return atanh(cast(double) x); } - - double cosh (double x); - version(Win64) float coshf(float x); - version(Win32) float coshf(float x) { return cast(float) cosh(x); } - extern(D) real coshl(real x) { return cosh(cast(double) x); } - - double sinh (double x); - version(Win64) float sinhf(float x); - version(Win32) float sinhf(float x) { return cast(float) sinh(x); } - extern(D) real sinhl(real x) { return sinh(cast(double) x); } - - double tanh (double x); - version(Win64) float tanhf(float x); - version(Win32) float tanhf(float x) { return cast(float) tanh(x); } - extern(D) real tanhl(real x) { return tanh(cast(double) x); } - - double exp (double x); - version(Win64) float expf(float x); - version(Win32) float expf(float x) { return cast(float) exp(x); } - extern(D) real expl(real x) { return exp(cast(double) x); } - - double exp2 (double x); - float exp2f(float x); - extern(D) real exp2l(real x) { return exp2(cast(double) x); } - - double expm1 (double x); - float expm1f(float x); - extern(D) real expm1l(real x) { return expm1(cast(double) x); } - - double frexp (double value, int* exp); - float frexpf(float value, int* exp) { return cast(float) frexp(value, exp); } - extern(D) real frexpl(real value, int* exp) { return frexp(cast(double) value, exp); } - - int ilogb (double x); - int ilogbf(float x); - extern(D) int ilogbl(real x) { return ilogb(cast(double) x); } - - double ldexp (double x, int exp); - float ldexpf(float x, int exp) { return cast(float) ldexp(x, exp); } - extern(D) real ldexpl(real x, int exp) { return ldexp(cast(double) x, exp); } - - double log (double x); - version(Win64) float logf(float x); - version(Win32) float logf(float x) { return cast(float) log(x); } - extern(D) real logl(real x) { return log(cast(double) x); } - - double log10 (double x); - version(Win64) float log10f(float x); - version(Win32) float log10f(float x) { return cast(float) log10(x); } - extern(D) real log10l(real x) { return log10(cast(double) x); } - - double log1p (double x); - float log1pf(float x); - extern(D) real log1pl(real x) { return log1p(cast(double) x); } - - double log2 (double x); - float log2f(float x); - extern(D) real log2l(real x) { return log2(cast(double) x); } - - double logb (double x); - float logbf(float x); - extern(D) real logbl(real x) { return logb(cast(double) x); } - - double modf (double value, double* iptr); - version(Win64) float modff(float value, float* iptr); - version(Win32) float modff(float value, float* iptr) - { - double i; - double r = modf(value, &i); - *iptr = cast(float) i; - return cast(float) r; - } - extern(D) real modfl(real value, real* iptr) - { - double i; - double r = modf(cast(double) value, &i); - *iptr = i; - return r; - } - - double scalbn (double x, int n); - float scalbnf(float x, int n); - extern(D) real scalbnl(real x, int n) { return scalbn(cast(double) x, n); } - - double scalbln (double x, c_long n); - float scalblnf(float x, c_long n); - extern(D) real scalblnl(real x, c_long n) { return scalbln(cast(double) x, n); } - - double cbrt (double x); - float cbrtf(float x); - extern(D) real cbrtl(real x) { return cbrt(cast(double) x); } - - double fabs (double x); - float fabsf(float x) { return cast(float) fabs(x); } - extern(D) real fabsl(real x) { return fabs(cast(double) x); } - - private float _hypotf(float x, float y); - double hypot (double x, double y); - float hypotf(float x, float y) { return _hypotf(x, y); } - extern(D) real hypotl(real x, real y) { return hypot(cast(double) x, cast(double) y); } - - double pow (double x, double y); - version(Win64) float powf(float x, float y); - version(Win32) float powf(float x, float y) { return cast(float) pow(x, y); } - extern(D) real powl(real x, real y) { return pow(cast(double) x, cast(double) y); } - - double sqrt (double x); - version(Win64) float sqrtf(float x); - version(Win32) float sqrtf(float x) { return cast(float) sqrt(x); } - extern(D) real sqrtl(real x) { return sqrt(cast(double) x); } - - double erf (double x); - float erff(float x); - extern(D) real erfl(real x) { return erf(cast(double) x); } - - double erfc (double x); - float erfcf(float x); - extern(D) real erfcl(real x) { return erfc(cast(double) x); } - - double lgamma (double x); - float lgammaf(float x); - extern(D) real lgammal(real x) { return lgamma(cast(double) x); } - - double tgamma (double x); - float tgammaf(float x); - extern(D) real tgammal(real x) { return tgamma(cast(double) x); } - - double ceil (double x); - version(Win64) float ceilf(float x); - version(Win32) float ceilf(float x) { return cast(float) ceil(x); } - extern(D) real ceill(real x) { return ceil(cast(double) x); } - - double floor (double x); - version(Win64) float floorf(float x); - version(Win32) float floorf(float x) { return cast(float) floor(x); } - extern(D) real floorl(real x) { return floor(cast(double) x); } - - double nearbyint (double x); - float nearbyintf(float x); - extern(D) real nearbyintl(real x) { return nearbyint(cast(double) x); } - - double rint (double x); - float rintf(float x); - extern(D) real rintl(real x) { return rint(cast(double) x); } - - c_long lrint (double x); - c_long lrintf(float x); - extern(D) c_long lrintl(real x) { return lrint(cast(double) x); } - - long llrint (double x); - long llrintf(float x); - extern(D) long llrintl(real x) { return llrint(cast(double) x); } - - double round (double x); - float roundf(float x); - extern(D) real roundl(real x) { return round(cast(double) x); } - - c_long lround (double x); - c_long lroundf(float x); - extern(D) c_long lroundl(real x) { return lround(cast(double) x); } - - long llround (double x); - long llroundf(float x); - extern(D) long llroundl(real x) { return llround(cast(double) x); } - - double trunc (double x); - float truncf(float x); - extern(D) real truncl(real x) { return trunc(cast(double) x); } - - double fmod (double x, double y); - version(Win64) float fmodf(float x, float y); - version(Win32) float fmodf(float x, float y) { return cast(float) fmod(x, y); } - extern(D) real fmodl(real x, real y) { return fmod(cast(double) x, cast(double) y); } - - double remainder (double x, double y); - float remainderf(float x, float y); - extern(D) real remainderl(real x, real y) { return remainder(cast(double) x, cast(double) y); } - - double remquo (double x, double y, int* quo); - float remquof(float x, float y, int* quo); - extern(D) real remquol(real x, real y, int* quo) { return remquo(cast(double) x, cast(double) y, quo); } - - double copysign (double x, double y); - float copysignf(float x, float y); - extern(D) real copysignl(real x, real y) { return copysign(cast(double) x, cast(double) y); } - - double nan (char* tagp); - float nanf(char* tagp); - extern(D) real nanl(char* tagp) { return nan(tagp); } - - double nextafter (double x, double y); - float nextafterf(float x, float y); - extern(D) real nextafterl(real x, real y) { return nextafter(cast(double) x, cast(double) y); } - - double nexttoward (double x, real y); - float nexttowardf(float x, real y); - extern(D) real nexttowardl(real x, real y) { return nexttoward(cast(double) x, cast(double) y); } - - double fdim (double x, double y); - float fdimf(float x, float y); - extern(D) real fdiml(real x, real y) { return fdim(cast(double) x, cast(double) y); } - - double fmax (double x, double y); - float fmaxf(float x, float y); - extern(D) real fmaxl(real x, real y) { return fmax(cast(double) x, cast(double) y); } - - double fmin (double x, double y); - float fminf(float x, float y); - extern(D) real fminl(real x, real y) { return fmin(cast(double) x, cast(double) y); } - - double fma (double x, double y, double z); - float fmaf(float x, float y, float z); - extern(D) real fmal(real x, real y, real z) { return fma(cast(double) x, cast(double) y, cast(double) z); } + /// + double acos(double x); + /// + float acosf(float x); + /// + extern(D) real acosl(real x) { return acos(cast(double) x); } + + /// + double asin(double x); + /// + float asinf(float x); + /// + extern(D) real asinl(real x) { return asin(cast(double) x); } + + /// + double atan(double x); + /// + float atanf(float x); + /// + extern(D) real atanl(real x) { return atan(cast(double) x); } + + /// + double atan2(double y, double x); + /// + float atan2f(float y, float x); + /// + extern(D) real atan2l(real y, real x) { return atan2(cast(double) y, cast(double) x); } + + /// + double cos(double x); + /// + float cosf(float x); + /// + extern(D) real cosl(real x) { return cos(cast(double) x); } + + /// + double sin(double x); + /// + float sinf(float x); + /// + extern(D) real sinl(real x) { return sin(cast(double) x); } + + /// + double tan(double x); + /// + float tanf(float x); + /// + extern(D) real tanl(real x) { return tan(cast(double) x); } + + /// + double acosh(double x); + /// + float acoshf(float x); + /// + extern(D) real acoshl(real x) { return acosh(cast(double) x); } + + /// + double asinh(double x); + /// + float asinhf(float x); + /// + extern(D) real asinhl(real x) { return asinh(cast(double) x); } + + /// + double atanh(double x); + /// + float atanhf(float x); + /// + extern(D) real atanhl(real x) { return atanh(cast(double) x); } + + /// + double cosh(double x); + /// + float coshf(float x); + /// + extern(D) real coshl(real x) { return cosh(cast(double) x); } + + /// + double sinh(double x); + /// + float sinhf(float x); + /// + extern(D) real sinhl(real x) { return sinh(cast(double) x); } + + /// + double tanh(double x); + /// + float tanhf(float x); + /// + extern(D) real tanhl(real x) { return tanh(cast(double) x); } + + /// + double exp(double x); + /// + float expf(float x); + /// + extern(D) real expl(real x) { return exp(cast(double) x); } + + /// + double exp2(double x); + /// + float exp2f(float x); + /// + extern(D) real exp2l(real x) { return exp2(cast(double) x); } + + /// + double expm1(double x); + /// + float expm1f(float x); + /// + extern(D) real expm1l(real x) { return expm1(cast(double) x); } + + /// + double frexp(double value, int* exp); + /// + extern(D) float frexpf(float value, int* exp) { return cast(float) frexp(value, exp); } + /// + extern(D) real frexpl(real value, int* exp) { return frexp(cast(double) value, exp); } + + /// + int ilogb(double x); + /// + int ilogbf(float x); + /// + extern(D) int ilogbl(real x) { return ilogb(cast(double) x); } + + /// + double ldexp(double x, int exp); + /// + extern(D) float ldexpf(float x, int exp) { return cast(float) ldexp(x, exp); } + /// + extern(D) real ldexpl(real x, int exp) { return ldexp(cast(double) x, exp); } + + /// + double log(double x); + /// + float logf(float x); + /// + extern(D) real logl(real x) { return log(cast(double) x); } + + /// + double log10(double x); + /// + float log10f(float x); + /// + extern(D) real log10l(real x) { return log10(cast(double) x); } + + /// + double log1p(double x); + /// + float log1pf(float x); + /// + extern(D) real log1pl(real x) { return log1p(cast(double) x); } + + /// + double log2(double x); + /// + float log2f(float x); + /// + extern(D) real log2l(real x) { return log2(cast(double) x); } + + /// + double logb(double x); + /// + float logbf(float x); + /// + extern(D) real logbl(real x) { return logb(cast(double) x); } + + /// + double modf(double value, double* iptr); + /// + float modff(float value, float* iptr); + /// + extern(D) real modfl(real value, real* iptr) + { + double i; + double r = modf(cast(double) value, &i); + *iptr = i; + return r; + } + + /// + double scalbn(double x, int n); + /// + float scalbnf(float x, int n); + /// + extern(D) real scalbnl(real x, int n) { return scalbn(cast(double) x, n); } + + /// + double scalbln(double x, c_long n); + /// + float scalblnf(float x, c_long n); + /// + extern(D) real scalblnl(real x, c_long n) { return scalbln(cast(double) x, n); } + + /// + double cbrt(double x); + /// + float cbrtf(float x); + /// + extern(D) real cbrtl(real x) { return cbrt(cast(double) x); } + + /// + double fabs(double x); + /// + extern(D) float fabsf(float x) { return cast(float) fabs(x); } + /// + extern(D) real fabsl(real x) { return fabs(cast(double) x); } + + private double _hypot(double x, double y); + private float _hypotf(float x, float y); + /// + extern(D) double hypot(double x, double y) { return _hypot(x, y); } + /// + extern(D) float hypotf(float x, float y) { return _hypotf(x, y); } + /// + extern(D) real hypotl(real x, real y) { return _hypot(cast(double) x, cast(double) y); } + + /// + double pow(double x, double y); + /// + float powf(float x, float y); + /// + extern(D) real powl(real x, real y) { return pow(cast(double) x, cast(double) y); } + + /// + double sqrt(double x); + /// + float sqrtf(float x); + /// + extern(D) real sqrtl(real x) { return sqrt(cast(double) x); } + + /// + double erf(double x); + /// + float erff(float x); + /// + extern(D) real erfl(real x) { return erf(cast(double) x); } + + /// + double erfc(double x); + /// + float erfcf(float x); + /// + extern(D) real erfcl(real x) { return erfc(cast(double) x); } + + /// + double lgamma(double x); + /// + float lgammaf(float x); + /// + extern(D) real lgammal(real x) { return lgamma(cast(double) x); } + + /// + double tgamma(double x); + /// + float tgammaf(float x); + /// + extern(D) real tgammal(real x) { return tgamma(cast(double) x); } + + /// + double ceil(double x); + /// + float ceilf(float x); + /// + extern(D) real ceill(real x) { return ceil(cast(double) x); } + + /// + double floor(double x); + /// + float floorf(float x); + /// + extern(D) real floorl(real x) { return floor(cast(double) x); } + + /// + double nearbyint(double x); + /// + float nearbyintf(float x); + /// + extern(D) real nearbyintl(real x) { return nearbyint(cast(double) x); } + + /// + double rint(double x); + /// + float rintf(float x); + /// + extern(D) real rintl(real x) { return rint(cast(double) x); } + + /// + c_long lrint(double x); + /// + c_long lrintf(float x); + /// + extern(D) c_long lrintl(real x) { return lrint(cast(double) x); } + + /// + long llrint(double x); + /// + long llrintf(float x); + /// + extern(D) long llrintl(real x) { return llrint(cast(double) x); } + + /// + double round(double x); + /// + float roundf(float x); + /// + extern(D) real roundl(real x) { return round(cast(double) x); } + + /// + c_long lround(double x); + /// + c_long lroundf(float x); + /// + extern(D) c_long lroundl(real x) { return lround(cast(double) x); } + + /// + long llround(double x); + /// + long llroundf(float x); + /// + extern(D) long llroundl(real x) { return llround(cast(double) x); } + + /// + double trunc(double x); + /// + float truncf(float x); + /// + extern(D) real truncl(real x) { return trunc(cast(double) x); } + + /// + double fmod(double x, double y); + /// + float fmodf(float x, float y); + /// + extern(D) real fmodl(real x, real y) { return fmod(cast(double) x, cast(double) y); } + + /// + double remainder(double x, double y); + /// + float remainderf(float x, float y); + /// + extern(D) real remainderl(real x, real y) { return remainder(cast(double) x, cast(double) y); } + + /// + double remquo(double x, double y, int* quo); + /// + float remquof(float x, float y, int* quo); + /// + extern(D) real remquol(real x, real y, int* quo) { return remquo(cast(double) x, cast(double) y, quo); } + + /// + double copysign(double x, double y); + /// + float copysignf(float x, float y); + /// + extern(D) real copysignl(real x, real y) { return copysign(cast(double) x, cast(double) y); } + + /// + double nan(char* tagp); + /// + float nanf(char* tagp); + /// + extern(D) real nanl(char* tagp) { return nan(tagp); } + + /// + double nextafter(double x, double y); + /// + float nextafterf(float x, float y); + /// + extern(D) real nextafterl(real x, real y) { return nextafter(cast(double) x, cast(double) y); } + + /// + double nexttoward(double x, real y); + /// + float nexttowardf(float x, real y); + /// + extern(D) real nexttowardl(real x, real y) { return nexttoward(cast(double) x, cast(double) y); } + + /// + double fdim(double x, double y); + /// + float fdimf(float x, float y); + /// + extern(D) real fdiml(real x, real y) { return fdim(cast(double) x, cast(double) y); } + + /// + double fmax(double x, double y); + /// + float fmaxf(float x, float y); + /// + extern(D) real fmaxl(real x, real y) { return fmax(cast(double) x, cast(double) y); } + + /// + double fmin(double x, double y); + /// + float fminf(float x, float y); + /// + extern(D) real fminl(real x, real y) { return fmin(cast(double) x, cast(double) y); } + + /// + double fma(double x, double y, double z); + /// + float fmaf(float x, float y, float z); + /// + extern(D) real fmal(real x, real y, real z) { return fma(cast(double) x, cast(double) y, cast(double) z); } } /* NOTE: freebsd < 8-CURRENT doesn't appear to support *l, but we can * approximate. From f1be5c8e360e16a734db72ebfb1316f2d202fec9 Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 4 Feb 2015 11:53:45 +0100 Subject: [PATCH 6/6] core.stdc.math: Work around linking errors with MSVCRT < 12 (VS 2013). --- src/core/stdc/math.d | 148 +++++++++++++++++++++---------------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/src/core/stdc/math.d b/src/core/stdc/math.d index 22d21b788b..6e020f85c3 100644 --- a/src/core/stdc/math.d +++ b/src/core/stdc/math.d @@ -292,11 +292,11 @@ else version( CRuntime_Microsoft ) // fully supported since MSVCRT 12 (VS 2013) { //int fpclassify(real-floating x); /// - int fpclassify(float x) { return _fdclass(x); } + int fpclassify()(float x) { return _fdclass(x); } /// - int fpclassify(double x) { return _dclass(x); } + int fpclassify()(double x) { return _dclass(x); } /// - int fpclassify(real x) + int fpclassify()(real x) { static if (real.sizeof == double.sizeof) return _dclass(cast(double) x); @@ -306,19 +306,19 @@ else version( CRuntime_Microsoft ) // fully supported since MSVCRT 12 (VS 2013) //int isfinite(real-floating x); /// - int isfinite(float x) { return fpclassify(x) <= 0; } + int isfinite()(float x) { return fpclassify(x) <= 0; } /// - int isfinite(double x) { return fpclassify(x) <= 0; } + int isfinite()(double x) { return fpclassify(x) <= 0; } /// - int isfinite(real x) { return fpclassify(x) <= 0; } + int isfinite()(real x) { return fpclassify(x) <= 0; } //int isinf(real-floating x); /// - int isinf(float x) { return fpclassify(x) == FP_INFINITE; } + int isinf()(float x) { return fpclassify(x) == FP_INFINITE; } /// - int isinf(double x) { return fpclassify(x) == FP_INFINITE; } + int isinf()(double x) { return fpclassify(x) == FP_INFINITE; } /// - int isinf(real x) { return fpclassify(x) == FP_INFINITE; } + int isinf()(real x) { return fpclassify(x) == FP_INFINITE; } //int isnan(real-floating x); version( none ) // requires MSVCRT 12+ (VS 2013) @@ -342,19 +342,19 @@ else version( CRuntime_Microsoft ) // fully supported since MSVCRT 12 (VS 2013) //int isnormal(real-floating x); /// - int isnormal(float x) { return fpclassify(x) == FP_NORMAL; } + int isnormal()(float x) { return fpclassify(x) == FP_NORMAL; } /// - int isnormal(double x) { return fpclassify(x) == FP_NORMAL; } + int isnormal()(double x) { return fpclassify(x) == FP_NORMAL; } /// - int isnormal(real x) { return fpclassify(x) == FP_NORMAL; } + int isnormal()(real x) { return fpclassify(x) == FP_NORMAL; } //int signbit(real-floating x); /// - int signbit(float x) { return _fdsign(x); } + int signbit()(float x) { return _fdsign(x); } /// - int signbit(double x) { return _dsign(x); } + int signbit()(double x) { return _dsign(x); } /// - int signbit(real x) + int signbit()(real x) { static if (real.sizeof == double.sizeof) return _dsign(cast(double) x); @@ -975,175 +975,175 @@ version( CRuntime_Microsoft ) // fully supported since MSVCRT 12 (VS 2013) only /// float acosf(float x); /// - extern(D) real acosl(real x) { return acos(cast(double) x); } + extern(D) real acosl()(real x) { return acos(cast(double) x); } /// double asin(double x); /// float asinf(float x); /// - extern(D) real asinl(real x) { return asin(cast(double) x); } + extern(D) real asinl()(real x) { return asin(cast(double) x); } /// double atan(double x); /// float atanf(float x); /// - extern(D) real atanl(real x) { return atan(cast(double) x); } + extern(D) real atanl()(real x) { return atan(cast(double) x); } /// double atan2(double y, double x); /// float atan2f(float y, float x); /// - extern(D) real atan2l(real y, real x) { return atan2(cast(double) y, cast(double) x); } + extern(D) real atan2l()(real y, real x) { return atan2(cast(double) y, cast(double) x); } /// double cos(double x); /// float cosf(float x); /// - extern(D) real cosl(real x) { return cos(cast(double) x); } + extern(D) real cosl()(real x) { return cos(cast(double) x); } /// double sin(double x); /// float sinf(float x); /// - extern(D) real sinl(real x) { return sin(cast(double) x); } + extern(D) real sinl()(real x) { return sin(cast(double) x); } /// double tan(double x); /// float tanf(float x); /// - extern(D) real tanl(real x) { return tan(cast(double) x); } + extern(D) real tanl()(real x) { return tan(cast(double) x); } /// double acosh(double x); /// float acoshf(float x); /// - extern(D) real acoshl(real x) { return acosh(cast(double) x); } + extern(D) real acoshl()(real x) { return acosh(cast(double) x); } /// double asinh(double x); /// float asinhf(float x); /// - extern(D) real asinhl(real x) { return asinh(cast(double) x); } + extern(D) real asinhl()(real x) { return asinh(cast(double) x); } /// double atanh(double x); /// float atanhf(float x); /// - extern(D) real atanhl(real x) { return atanh(cast(double) x); } + extern(D) real atanhl()(real x) { return atanh(cast(double) x); } /// double cosh(double x); /// float coshf(float x); /// - extern(D) real coshl(real x) { return cosh(cast(double) x); } + extern(D) real coshl()(real x) { return cosh(cast(double) x); } /// double sinh(double x); /// float sinhf(float x); /// - extern(D) real sinhl(real x) { return sinh(cast(double) x); } + extern(D) real sinhl()(real x) { return sinh(cast(double) x); } /// double tanh(double x); /// float tanhf(float x); /// - extern(D) real tanhl(real x) { return tanh(cast(double) x); } + extern(D) real tanhl()(real x) { return tanh(cast(double) x); } /// double exp(double x); /// float expf(float x); /// - extern(D) real expl(real x) { return exp(cast(double) x); } + extern(D) real expl()(real x) { return exp(cast(double) x); } /// double exp2(double x); /// float exp2f(float x); /// - extern(D) real exp2l(real x) { return exp2(cast(double) x); } + extern(D) real exp2l()(real x) { return exp2(cast(double) x); } /// double expm1(double x); /// float expm1f(float x); /// - extern(D) real expm1l(real x) { return expm1(cast(double) x); } + extern(D) real expm1l()(real x) { return expm1(cast(double) x); } /// double frexp(double value, int* exp); /// - extern(D) float frexpf(float value, int* exp) { return cast(float) frexp(value, exp); } + extern(D) float frexpf()(float value, int* exp) { return cast(float) frexp(value, exp); } /// - extern(D) real frexpl(real value, int* exp) { return frexp(cast(double) value, exp); } + extern(D) real frexpl()(real value, int* exp) { return frexp(cast(double) value, exp); } /// int ilogb(double x); /// int ilogbf(float x); /// - extern(D) int ilogbl(real x) { return ilogb(cast(double) x); } + extern(D) int ilogbl()(real x) { return ilogb(cast(double) x); } /// double ldexp(double x, int exp); /// - extern(D) float ldexpf(float x, int exp) { return cast(float) ldexp(x, exp); } + extern(D) float ldexpf()(float x, int exp) { return cast(float) ldexp(x, exp); } /// - extern(D) real ldexpl(real x, int exp) { return ldexp(cast(double) x, exp); } + extern(D) real ldexpl()(real x, int exp) { return ldexp(cast(double) x, exp); } /// double log(double x); /// float logf(float x); /// - extern(D) real logl(real x) { return log(cast(double) x); } + extern(D) real logl()(real x) { return log(cast(double) x); } /// double log10(double x); /// float log10f(float x); /// - extern(D) real log10l(real x) { return log10(cast(double) x); } + extern(D) real log10l()(real x) { return log10(cast(double) x); } /// double log1p(double x); /// float log1pf(float x); /// - extern(D) real log1pl(real x) { return log1p(cast(double) x); } + extern(D) real log1pl()(real x) { return log1p(cast(double) x); } /// double log2(double x); /// float log2f(float x); /// - extern(D) real log2l(real x) { return log2(cast(double) x); } + extern(D) real log2l()(real x) { return log2(cast(double) x); } /// double logb(double x); /// float logbf(float x); /// - extern(D) real logbl(real x) { return logb(cast(double) x); } + extern(D) real logbl()(real x) { return logb(cast(double) x); } /// double modf(double value, double* iptr); /// float modff(float value, float* iptr); /// - extern(D) real modfl(real value, real* iptr) + extern(D) real modfl()(real value, real* iptr) { double i; double r = modf(cast(double) value, &i); @@ -1156,28 +1156,28 @@ version( CRuntime_Microsoft ) // fully supported since MSVCRT 12 (VS 2013) only /// float scalbnf(float x, int n); /// - extern(D) real scalbnl(real x, int n) { return scalbn(cast(double) x, n); } + extern(D) real scalbnl()(real x, int n) { return scalbn(cast(double) x, n); } /// double scalbln(double x, c_long n); /// float scalblnf(float x, c_long n); /// - extern(D) real scalblnl(real x, c_long n) { return scalbln(cast(double) x, n); } + extern(D) real scalblnl()(real x, c_long n) { return scalbln(cast(double) x, n); } /// double cbrt(double x); /// float cbrtf(float x); /// - extern(D) real cbrtl(real x) { return cbrt(cast(double) x); } + extern(D) real cbrtl()(real x) { return cbrt(cast(double) x); } /// double fabs(double x); /// - extern(D) float fabsf(float x) { return cast(float) fabs(x); } + extern(D) float fabsf()(float x) { return cast(float) fabs(x); } /// - extern(D) real fabsl(real x) { return fabs(cast(double) x); } + extern(D) real fabsl()(real x) { return fabs(cast(double) x); } private double _hypot(double x, double y); private float _hypotf(float x, float y); @@ -1193,189 +1193,189 @@ version( CRuntime_Microsoft ) // fully supported since MSVCRT 12 (VS 2013) only /// float powf(float x, float y); /// - extern(D) real powl(real x, real y) { return pow(cast(double) x, cast(double) y); } + extern(D) real powl()(real x, real y) { return pow(cast(double) x, cast(double) y); } /// double sqrt(double x); /// float sqrtf(float x); /// - extern(D) real sqrtl(real x) { return sqrt(cast(double) x); } + extern(D) real sqrtl()(real x) { return sqrt(cast(double) x); } /// double erf(double x); /// float erff(float x); /// - extern(D) real erfl(real x) { return erf(cast(double) x); } + extern(D) real erfl()(real x) { return erf(cast(double) x); } /// double erfc(double x); /// float erfcf(float x); /// - extern(D) real erfcl(real x) { return erfc(cast(double) x); } + extern(D) real erfcl()(real x) { return erfc(cast(double) x); } /// double lgamma(double x); /// float lgammaf(float x); /// - extern(D) real lgammal(real x) { return lgamma(cast(double) x); } + extern(D) real lgammal()(real x) { return lgamma(cast(double) x); } /// double tgamma(double x); /// float tgammaf(float x); /// - extern(D) real tgammal(real x) { return tgamma(cast(double) x); } + extern(D) real tgammal()(real x) { return tgamma(cast(double) x); } /// double ceil(double x); /// float ceilf(float x); /// - extern(D) real ceill(real x) { return ceil(cast(double) x); } + extern(D) real ceill()(real x) { return ceil(cast(double) x); } /// double floor(double x); /// float floorf(float x); /// - extern(D) real floorl(real x) { return floor(cast(double) x); } + extern(D) real floorl()(real x) { return floor(cast(double) x); } /// double nearbyint(double x); /// float nearbyintf(float x); /// - extern(D) real nearbyintl(real x) { return nearbyint(cast(double) x); } + extern(D) real nearbyintl()(real x) { return nearbyint(cast(double) x); } /// double rint(double x); /// float rintf(float x); /// - extern(D) real rintl(real x) { return rint(cast(double) x); } + extern(D) real rintl()(real x) { return rint(cast(double) x); } /// c_long lrint(double x); /// c_long lrintf(float x); /// - extern(D) c_long lrintl(real x) { return lrint(cast(double) x); } + extern(D) c_long lrintl()(real x) { return lrint(cast(double) x); } /// long llrint(double x); /// long llrintf(float x); /// - extern(D) long llrintl(real x) { return llrint(cast(double) x); } + extern(D) long llrintl()(real x) { return llrint(cast(double) x); } /// double round(double x); /// float roundf(float x); /// - extern(D) real roundl(real x) { return round(cast(double) x); } + extern(D) real roundl()(real x) { return round(cast(double) x); } /// c_long lround(double x); /// c_long lroundf(float x); /// - extern(D) c_long lroundl(real x) { return lround(cast(double) x); } + extern(D) c_long lroundl()(real x) { return lround(cast(double) x); } /// long llround(double x); /// long llroundf(float x); /// - extern(D) long llroundl(real x) { return llround(cast(double) x); } + extern(D) long llroundl()(real x) { return llround(cast(double) x); } /// double trunc(double x); /// float truncf(float x); /// - extern(D) real truncl(real x) { return trunc(cast(double) x); } + extern(D) real truncl()(real x) { return trunc(cast(double) x); } /// double fmod(double x, double y); /// float fmodf(float x, float y); /// - extern(D) real fmodl(real x, real y) { return fmod(cast(double) x, cast(double) y); } + extern(D) real fmodl()(real x, real y) { return fmod(cast(double) x, cast(double) y); } /// double remainder(double x, double y); /// float remainderf(float x, float y); /// - extern(D) real remainderl(real x, real y) { return remainder(cast(double) x, cast(double) y); } + extern(D) real remainderl()(real x, real y) { return remainder(cast(double) x, cast(double) y); } /// double remquo(double x, double y, int* quo); /// float remquof(float x, float y, int* quo); /// - extern(D) real remquol(real x, real y, int* quo) { return remquo(cast(double) x, cast(double) y, quo); } + extern(D) real remquol()(real x, real y, int* quo) { return remquo(cast(double) x, cast(double) y, quo); } /// double copysign(double x, double y); /// float copysignf(float x, float y); /// - extern(D) real copysignl(real x, real y) { return copysign(cast(double) x, cast(double) y); } + extern(D) real copysignl()(real x, real y) { return copysign(cast(double) x, cast(double) y); } /// double nan(char* tagp); /// float nanf(char* tagp); /// - extern(D) real nanl(char* tagp) { return nan(tagp); } + extern(D) real nanl()(char* tagp) { return nan(tagp); } /// double nextafter(double x, double y); /// float nextafterf(float x, float y); /// - extern(D) real nextafterl(real x, real y) { return nextafter(cast(double) x, cast(double) y); } + extern(D) real nextafterl()(real x, real y) { return nextafter(cast(double) x, cast(double) y); } /// double nexttoward(double x, real y); /// float nexttowardf(float x, real y); /// - extern(D) real nexttowardl(real x, real y) { return nexttoward(cast(double) x, cast(double) y); } + extern(D) real nexttowardl()(real x, real y) { return nexttoward(cast(double) x, cast(double) y); } /// double fdim(double x, double y); /// float fdimf(float x, float y); /// - extern(D) real fdiml(real x, real y) { return fdim(cast(double) x, cast(double) y); } + extern(D) real fdiml()(real x, real y) { return fdim(cast(double) x, cast(double) y); } /// double fmax(double x, double y); /// float fmaxf(float x, float y); /// - extern(D) real fmaxl(real x, real y) { return fmax(cast(double) x, cast(double) y); } + extern(D) real fmaxl()(real x, real y) { return fmax(cast(double) x, cast(double) y); } /// double fmin(double x, double y); /// float fminf(float x, float y); /// - extern(D) real fminl(real x, real y) { return fmin(cast(double) x, cast(double) y); } + extern(D) real fminl()(real x, real y) { return fmin(cast(double) x, cast(double) y); } /// double fma(double x, double y, double z); /// float fmaf(float x, float y, float z); /// - extern(D) real fmal(real x, real y, real z) { return fma(cast(double) x, cast(double) y, cast(double) z); } + extern(D) real fmal()(real x, real y, real z) { return fma(cast(double) x, cast(double) y, cast(double) z); } } /* NOTE: freebsd < 8-CURRENT doesn't appear to support *l, but we can * approximate.