Mercurial Hosting > luan
comparison website/src/manual.html.luan @ 1680:9ef19f5ea973
add // operator
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 02 Jun 2022 22:34:55 -0600 |
parents | 0046c5eb3315 |
children | 19df8abc9805 |
comparison
equal
deleted
inserted
replaced
1679:39287902fb0c | 1680:9ef19f5ea973 |
---|---|
286 </p></li> | 286 </p></li> |
287 | 287 |
288 <li><p> | 288 <li><p> |
289 <b>"div": </b> | 289 <b>"div": </b> |
290 the <code>/</code> operation. | 290 the <code>/</code> operation. |
291 Behavior similar to the "add" operation. | |
292 </p></li> | |
293 | |
294 <li><p> | |
295 <b>"idiv": </b> | |
296 the <code>//</code> operation. | |
291 Behavior similar to the "add" operation. | 297 Behavior similar to the "add" operation. |
292 </p></li> | 298 </p></li> |
293 | 299 |
294 <li><p> | 300 <li><p> |
295 <b>"mod": </b> | 301 <b>"mod": </b> |
1268 | 1274 |
1269 <ul> | 1275 <ul> |
1270 <li><b><code>+</code>: </b>addition</li> | 1276 <li><b><code>+</code>: </b>addition</li> |
1271 <li><b><code>-</code>: </b>subtraction</li> | 1277 <li><b><code>-</code>: </b>subtraction</li> |
1272 <li><b><code>*</code>: </b>multiplication</li> | 1278 <li><b><code>*</code>: </b>multiplication</li> |
1273 <li><b><code>/</code>: </b>division</li> | 1279 <li><b><code>/</code>: </b>float division</li> |
1280 <li><b><code>//</code>: </b>floor division</li> | |
1274 <li><b><code>%</code>: </b>modulo</li> | 1281 <li><b><code>%</code>: </b>modulo</li> |
1275 <li><b><code>^</code>: </b>exponentiation</li> | 1282 <li><b><code>^</code>: </b>exponentiation</li> |
1276 <li><b><code>-</code>: </b>unary minus</li> | 1283 <li><b><code>-</code>: </b>unary minus</li> |
1277 </ul> | 1284 </ul> |
1278 | 1285 |
1279 <p> | 1286 <p> |
1280 Addition, subtraction, multiplication, division, and unary minus are the same as these operators in Java. Exponentiation uses Java's <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Math.html#pow(double,%20double)">Math.pow</a> function. | 1287 Addition, subtraction, multiplication, division, and unary minus are the same as these operators in Java. Exponentiation uses Java's <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Math.html#pow(double,%20double)">Math.pow</a> function. |
1288 </p> | |
1289 | |
1290 <p> | |
1291 Floor division (//) is a division that rounds the quotient towards minus infinity, that is, the floor of the division of its operands. | |
1281 </p> | 1292 </p> |
1282 | 1293 |
1283 <p> | 1294 <p> |
1284 Modulo is defined as the remainder of a division | 1295 Modulo is defined as the remainder of a division |
1285 that rounds the quotient towards minus infinite (floor division). | 1296 that rounds the quotient towards minus infinite (floor division). |