Loops/While: Difference between revisions
Content added Content deleted
(Add example for blz) |
(→{{header|blz}}: Stop the final iteration (so it doesn't print 1/2)) |
||
Line 295: | Line 295: | ||
=={{header|blz}}== |
=={{header|blz}}== |
||
<lang blz>num = 1024 |
<lang blz>num = 1024 |
||
while num > |
while num > 1 # blz will automatically cast num to a fraction when dividing 1/2, so this is necessary to stop an infinite loop |
||
print(num) |
print(num) |
||
num = num / 2 |
num = num / 2 |