@@ -17,7 +17,7 @@ macro_rules! boolean_op {
1717 } ;
1818}
1919
20- macro_rules! map_op {
20+ macro_rules! unary_op {
2121 ( $( #[ $meta: meta] ) * fn $id: ident) => {
2222 $( #[ $meta] ) *
2323 pub fn $id( & self ) -> Array <A , D > {
@@ -26,7 +26,7 @@ macro_rules! map_op {
2626 } ;
2727}
2828
29- macro_rules! bin_op {
29+ macro_rules! binary_op {
3030 ( $( #[ $meta: meta] ) * fn $id: ident( $ty: ty) ) => {
3131 $( #[ $meta] ) *
3232 pub fn $id( & self , rhs: $ty) -> Array <A , D > {
@@ -56,49 +56,49 @@ where
5656 /// Return `true` if any element is infinity.
5757 fn is_infinite_any -> is_infinite
5858 }
59- map_op ! {
59+ unary_op ! {
6060 /// The largest integer less than or equal to each element.
6161 fn floor
6262 }
63- map_op ! {
63+ unary_op ! {
6464 /// The smallest integer less than or equal to each element.
6565 fn ceil
6666 }
67- map_op ! {
67+ unary_op ! {
6868 /// The nearest integer of each element.
6969 fn round
7070 }
71- map_op ! {
71+ unary_op ! {
7272 /// The integer part of each element.
7373 fn trunc
7474 }
75- map_op ! {
75+ unary_op ! {
7676 /// The fractional part of each element.
7777 fn fract
7878 }
79- map_op ! {
79+ unary_op ! {
8080 /// Absolute of each element.
8181 fn abs
8282 }
83- map_op ! {
83+ unary_op ! {
8484 /// Sign number of each element.
8585 ///
8686 /// + `1.0` for all positive numbers.
8787 /// + `-1.0` for all negative numbers.
8888 /// + `NaN` for all `NaN` (not a number).
8989 fn signum
9090 }
91- map_op ! {
91+ unary_op ! {
9292 /// The reciprocal (inverse) of each element, `1/x`.
9393 fn recip
9494 }
95- bin_op ! {
95+ binary_op ! {
9696 /// Integer power of each element.
9797 ///
9898 /// This function is generally faster than using float power.
9999 fn powi( i32 )
100100 }
101- bin_op ! {
101+ binary_op ! {
102102 /// Float power of each element.
103103 fn powf( A )
104104 }
@@ -108,59 +108,59 @@ where
108108 self . mapv ( |v| v * v)
109109 }
110110
111- map_op ! {
111+ unary_op ! {
112112 /// Square root of each element.
113113 fn sqrt
114114 }
115- map_op ! {
115+ unary_op ! {
116116 /// `e^x` of each element. (Exponential function)
117117 fn exp
118118 }
119- map_op ! {
119+ unary_op ! {
120120 /// `2^x` of each element.
121121 fn exp2
122122 }
123- map_op ! {
123+ unary_op ! {
124124 /// Natural logarithm of each element.
125125 fn ln
126126 }
127- bin_op ! {
127+ binary_op ! {
128128 /// Logarithm of each element with respect to an arbitrary base.
129129 fn log( A )
130130 }
131- map_op ! {
131+ unary_op ! {
132132 /// Base 2 logarithm of each element.
133133 fn log2
134134 }
135- map_op ! {
135+ unary_op ! {
136136 /// Base 10 logarithm of each element.
137137 fn log10
138138 }
139- bin_op ! {
139+ binary_op ! {
140140 /// The positive difference between given number and each element.
141141 fn abs_sub( A )
142142 }
143- map_op ! {
143+ unary_op ! {
144144 /// Cubic root of each element.
145145 fn cbrt
146146 }
147- map_op ! {
147+ unary_op ! {
148148 /// Sine of each element. (in radians)
149149 fn sin
150150 }
151- map_op ! {
151+ unary_op ! {
152152 /// Cosine of each element. (in radians)
153153 fn cos
154154 }
155- map_op ! {
155+ unary_op ! {
156156 /// Tangent of each element. (in radians)
157157 fn tan
158158 }
159- map_op ! {
159+ unary_op ! {
160160 /// Converts radians to degrees for each element.
161161 fn to_degrees
162162 }
163- map_op ! {
163+ unary_op ! {
164164 /// Converts degrees to radians for each element.
165165 fn to_radians
166166 }
0 commit comments