@@ -135,7 +135,11 @@ Mathematical Operators
135
135
136
136
.. Docstring generated from Julia source
137
137
138
- Modulus after division, returning in the range [0,``y``\ ), if ``y `` is positive, or (``y ``\ ,0] if ``y `` is negative.
138
+ Modulus after flooring division, returning in the range [0,``y``\ ), if ``y `` is positive, or (``y ``\ ,0] if ``y `` is negative.
139
+
140
+ .. code-block :: julia
141
+
142
+ x == fld(x,y)*y + mod(x,y)
139
143
140
144
.. function :: mod2pi(x)
141
145
@@ -152,29 +156,51 @@ Mathematical Operators
152
156
153
157
Remainder from Euclidean division, returning a value of the same sign as ``x ``\ , and smaller in magnitude than ``y ``\ . This value is always exact.
154
158
159
+ .. code-block :: julia
160
+
161
+ x == div(x,y)*y + rem(x,y)
162
+
155
163
.. function :: divrem(x, y)
156
164
157
165
.. Docstring generated from Julia source
158
166
159
- The quotient and remainder from Euclidean division. Equivalent to ``(x÷y, x%y) ``\ .
167
+ The quotient and remainder from Euclidean division. Equivalent to ``(div(x,y), rem(x,y)) `` or `` ( x÷y, x%y) ``\ .
160
168
161
169
.. function :: fldmod(x, y)
162
170
163
171
.. Docstring generated from Julia source
164
172
165
173
The floored quotient and modulus after division. Equivalent to ``(fld(x,y), mod(x,y)) ``\ .
166
174
167
- .. function :: mod1(x,m)
175
+ .. function :: fld1(x, y)
176
+
177
+ .. Docstring generated from Julia source
178
+
179
+ Flooring division, returning a value consistent with ``mod1(x,y) ``
180
+
181
+ .. code-block :: julia
182
+
183
+ x == fld(x,y)*y + mod(x,y)
184
+
185
+ x == (fld1(x,y)-1)*y + mod1(x,y)
186
+
187
+ .. function :: mod1(x, y)
188
+
189
+ .. Docstring generated from Julia source
190
+
191
+ Modulus after flooring division, returning a value in the range ``(0,y\] ``
192
+
193
+ .. function :: fldmod1(x, y)
168
194
169
195
.. Docstring generated from Julia source
170
196
171
- Modulus after division, returning in the range (0,m]
197
+ Return `` (fld1(x,y), mod1(x,y)) ``
172
198
173
- .. function :: rem1(x,m )
199
+ .. function :: rem1(x, y )
174
200
175
201
.. Docstring generated from Julia source
176
202
177
- Remainder after division, returning in the range (0,m]
203
+ (Deprecated.) Remainder after division, returning in the range `` (0,y\] ``
178
204
179
205
.. _// :
180
206
.. function :: //(num, den)
0 commit comments