@@ -107,26 +107,47 @@ else
107
107
{
108
108
static import std.math ;
109
109
import std.traits : isFloatingPoint;
110
+ // /
110
111
T sqrt (T)(in T x) if (isFloatingPoint! T) { return std.math.sqrt (x); }
112
+ // /
111
113
T sin (T)(in T x) if (isFloatingPoint! T) { return std.math.sin (x); }
114
+ // /
112
115
T cos (T)(in T x) if (isFloatingPoint! T) { return std.math.cos (x); }
116
+ // /
113
117
T pow (T)(in T x, in T power) if (isFloatingPoint! T) { return std.math.pow (x, power); }
118
+ // /
114
119
T powi (T)(in T x, int power) if (isFloatingPoint! T) { return std.math.pow (x, power); }
120
+ // /
115
121
T exp (T)(in T x) if (isFloatingPoint! T) { return std.math.exp (x); }
122
+ // /
116
123
T log (T)(in T x) if (isFloatingPoint! T) { return std.math.log (x); }
124
+ // /
117
125
T fabs (T)(in T x) if (isFloatingPoint! T) { return std.math.fabs (x); }
126
+ // /
118
127
T floor (T)(in T x) if (isFloatingPoint! T) { return std.math.floor (x); }
128
+ // /
119
129
T exp2 (T)(in T x) if (isFloatingPoint! T) { return std.math.exp2 (x); }
130
+ // /
120
131
T log10 (T)(in T x) if (isFloatingPoint! T) { return std.math.log10 (x); }
132
+ // /
121
133
T log2 (T)(in T x) if (isFloatingPoint! T) { return std.math.log2 (x); }
134
+ // /
122
135
T ceil (T)(in T x) if (isFloatingPoint! T) { return std.math.ceil (x); }
136
+ // /
123
137
T trunc (T)(in T x) if (isFloatingPoint! T) { return std.math.trunc (x); }
138
+ // /
124
139
T rint (T)(in T x) if (isFloatingPoint! T) { return std.math.rint (x); }
140
+ // /
125
141
T nearbyint (T)(in T x) if (isFloatingPoint! T) { return std.math.nearbyint (x); }
142
+ // /
126
143
T copysign (T)(in T mag, in T sgn) if (isFloatingPoint! T) { return std.math.copysign (mag, sgn); }
144
+ // /
127
145
T round (T)(in T x) if (isFloatingPoint! T) { return std.math.round (x); }
146
+ // /
128
147
T fmuladd (T)(in T a, in T b, in T c) if (isFloatingPoint! T) { return a * b + c; }
129
148
unittest { assert (fmuladd! double (2 , 3 , 4 ) == 2 * 3 + 4 ); }
149
+ // /
130
150
T fmin (T)(in T x, in T y) if (isFloatingPoint! T) { return std.math.fmin (x, y); }
151
+ // /
131
152
T fmax (T)(in T x, in T y) if (isFloatingPoint! T) { return std.math.fmax (x, y); }
132
153
}
0 commit comments