@@ -7,7 +7,6 @@ import std::math::matrix;
77import std::math::quaternion;
88
99attrdef @MathLibc (name ) = @extern (name ), @link (env::POSIX , " m " );
10- attrdef @LinkMath = @link (env::POSIX , " m " );
1110
1211const E = 2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466 ;
1312const LOG2E = 1.44269504088896340735992468100189214 ; // log2(e)
@@ -235,14 +234,14 @@ macro asinh(x)
235234<*
236235 @require values::@is_floatlike(x) : `The input must be a floating point value or float vector`
237236*>
238- macro ceil (x ) @LinkMath => $$ceil (x );
237+ macro ceil (x ) => $$ceil (x );
239238
240239<*
241240 Ceil for compile time evaluation.
242241
243242 @require @typeis($input, double) || @typeis($input, float) : "Only float and double may be used"
244243*>
245- macro @ceil ($input ) @const @LinkMath => $$ceil ($input );
244+ macro @ceil ($input ) @const => $$ceil ($input );
246245
247246<*
248247 Constrain the value to lie within the given interval.
@@ -256,18 +255,18 @@ macro @ceil($input) @const @LinkMath => $$ceil($input);
256255 @require values::@assign_to(lower, x) : `The lower bound must be convertable to the value type.`
257256 @require values::@assign_to(upper, x) : `The upper bound must be convertable to the value type.`
258257*>
259- macro clamp (x , lower , upper ) @LinkMath => $$max (($typeof (x ))lower , $$min (x , ($typeof (x ))upper ));
258+ macro clamp (x , lower , upper ) => $$max (($typeof (x ))lower , $$min (x , ($typeof (x ))upper ));
260259
261260<*
262261 @require values::@is_promotable_to_floatlike(mag) : `The input must be a number value or float vector`
263262 @require $defined(($typeof(values::promote_int(mag)))mag) : `It's not possible to cast the sign to the type of the magnitude`
264263*>
265- macro copysign (mag , sgn ) @LinkMath => $$copysign (values::promote_int_same (mag , sgn ), ($typeof (values::promote_int_same (mag , sgn )))sgn );
264+ macro copysign (mag , sgn ) => $$copysign (values::promote_int_same (mag , sgn ), ($typeof (values::promote_int_same (mag , sgn )))sgn );
266265
267266<*
268267 @require values::@is_promotable_to_floatlike(x) : `The input must be a number value or float vector`
269268*>
270- macro cos (x ) @LinkMath => $$cos (values::promote_int (x ));
269+ macro cos (x ) => $$cos (values::promote_int (x ));
271270
272271<*
273272 @require values::@is_promotable_to_floatlike(x) : `The input must be a number value or float vector`
@@ -297,17 +296,17 @@ macro cotanh(x) => (exp(2.0 * x) + 1.0) / (exp(2.0 * x) - 1.0);
297296<*
298297 @require values::@is_promotable_to_floatlike(x) : `The input must be a number value or float vector`
299298*>
300- macro exp (x ) @LinkMath => $$exp (values::promote_int (x ));
299+ macro exp (x ) => $$exp (values::promote_int (x ));
301300
302301<*
303302 @require values::@is_promotable_to_floatlike(x) : `The input must be a number value or float vector`
304303*>
305- macro exp2 (x ) @LinkMath => $$exp2 (values::promote_int (x ));
304+ macro exp2 (x ) => $$exp2 (values::promote_int (x ));
306305
307306<*
308307 @require values::@is_promotable_to_floatlike(x) : `The input must be a number value or float vector`
309308*>
310- macro floor (x ) @LinkMath => $$floor (values::promote_int (x ));
309+ macro floor (x ) => $$floor (values::promote_int (x ));
311310
312311<*
313312 @require values::@is_promotable_to_floatlike(a) : `The input must be a number or float vector`
@@ -316,7 +315,7 @@ macro floor(x) @LinkMath => $$floor(values::promote_int(x));
316315 @require values::@is_same_vector_type(a, b) : `The input types must be equal`
317316 @require values::@is_same_vector_type(a, c) : `The input types must match`
318317*>
319- macro fma (a , b , c ) @LinkMath => $$fma (a , b , c );
318+ macro fma (a , b , c ) => $$fma (a , b , c );
320319
321320
322321<*
@@ -329,26 +328,26 @@ macro hypot(x, y) => sqrt(sqr(x) + sqr(y));
329328<*
330329 @require values::@is_promotable_to_floatlike(x) : `The input must be a number or a float vector`
331330*>
332- macro ln (x ) @LinkMath => $$log (values::promote_int (x ));
331+ macro ln (x ) => $$log (values::promote_int (x ));
333332
334333<*
335334 @require values::@is_promotable_to_floatlike(x) : `The input must be a number or a float vector`
336335 @require values::@is_promotable_to_floatlike(base) : `The base must be a number or a float vector`
337336*>
338- macro log (x , base ) @LinkMath
337+ macro log (x , base )
339338{
340339 return $$log (values::promote_int_same (x , base )) / $$log (values::promote_int_same (base , x ));
341340}
342341
343342<*
344343 @require values::@is_promotable_to_floatlike(x) : `The input must be a number or a float vector`
345344*>
346- macro log2 (x ) @LinkMath => $$log2 (values::promote_int (x ));
345+ macro log2 (x ) => $$log2 (values::promote_int (x ));
347346
348347<*
349348 @require values::@is_promotable_to_floatlike(x) : `The input must be a number or a float vector`
350349*>
351- macro log10 (x ) @LinkMath => $$log10 (values::promote_int (x ));
350+ macro log10 (x ) => $$log10 (values::promote_int (x ));
352351
353352<*
354353 @require types::is_numerical($typeof(x)) : `The input must be a floating point value or float vector`
@@ -1095,21 +1094,21 @@ fn float _frexpf(float x, int* e)
10951094 }
10961095}
10971096
1098- macro overflow_add_helper (x , y ) @local @LinkMath
1097+ macro overflow_add_helper (x , y ) @local
10991098{
11001099 $typeof (x ) res @noinit ;
11011100 if ($$overflow_add (x , y , & res )) return OVERFLOW ? ;
11021101 return res ;
11031102}
11041103
1105- macro overflow_sub_helper (x , y ) @local @LinkMath
1104+ macro overflow_sub_helper (x , y ) @local
11061105{
11071106 $typeof (x ) res @noinit ;
11081107 if ($$overflow_sub (x , y , & res )) return OVERFLOW ? ;
11091108 return res ;
11101109}
11111110
1112- macro overflow_mul_helper (x , y ) @local @LinkMath
1111+ macro overflow_mul_helper (x , y ) @local
11131112{
11141113 $typeof (x ) res @noinit ;
11151114 if ($$overflow_mul (x , y , & res )) return OVERFLOW ? ;
@@ -1123,7 +1122,7 @@ macro overflow_mul_helper(x, y) @local @LinkMath
11231122 @require values::@is_flat_intlike(a) &&& values::@is_flat_intlike(b) : "a and b must both be integer or integer vector based"
11241123 @require $defined(*out) &&& values::@is_same_type(*out, a) : "out must be a pointer of the same type as a and b"
11251124*>
1126- macro bool overflow_add (a , b , out ) @LinkMath => $$overflow_add (a , b , out );
1125+ macro bool overflow_add (a , b , out ) => $$overflow_add (a , b , out );
11271126
11281127<*
11291128 @param [&out] out : "Where the result of the subtraction is stored"
@@ -1132,7 +1131,7 @@ macro bool overflow_add(a, b, out) @LinkMath => $$overflow_add(a, b, out);
11321131 @require values::@is_flat_intlike(a) &&& values::@is_flat_intlike(b) : "a and b must both be integer or integer vector based"
11331132 @require $defined(*out) &&& values::@is_same_type(*out, a) : "out must be a pointer of the same type as a and b"
11341133*>
1135- macro bool overflow_sub (a , b , out ) @LinkMath => $$overflow_sub (a , b , out );
1134+ macro bool overflow_sub (a , b , out ) => $$overflow_sub (a , b , out );
11361135
11371136<*
11381137 @param [&out] out : "Where the result of the multiplication is stored"
@@ -1141,7 +1140,7 @@ macro bool overflow_sub(a, b, out) @LinkMath => $$overflow_sub(a, b, out);
11411140 @require values::@is_flat_intlike(a) &&& values::@is_flat_intlike(b) : "a and b must both be integer or integer vector based"
11421141 @require $defined(*out) &&& values::@is_same_type(*out, a) : "out must be a pointer of the same type as a and b"
11431142*>
1144- macro bool overflow_mul (a , b , out ) @LinkMath => $$overflow_mul (a , b , out );
1143+ macro bool overflow_mul (a , b , out ) => $$overflow_mul (a , b , out );
11451144
11461145<*
11471146 @require types::is_vector($Type) || ($Type.kindof == ARRAY &&& types::is_numerical($typefrom($Type.inner)))
0 commit comments