File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 44
55Rounds x downwards to the nearest integer.
66
7- I think / 1 will convert a number to an integer in less keystrokes than INT, they both round down for positives and up for negatives.
7+ x\ 1 will convert a x to an integer in less keystrokes than INT, they both round down for positives and up for negatives.
88In other words, they both drop the fractional part of the number.
99
10- ~~~
11-
10+ ```
1211'INT or alternate.bas 2016-03-06 SmallBASIC 0.12.2 [B+=MGA]
13- 'I think number\\ 1 is eqivalent to INT(number) in less keystrokes
12+ 'I think number\1 is eqivalent to INT(number) in less keystrokes
1413' both of these convert a number to an integer and both round down to do it.
1514for i = 1 to 20
1615 'which coin should I use
17- if rnd<.5 then TF=int(rnd*2) else TF=rnd*2\\ 1
16+ if rnd<.5 then TF=int(rnd*2) else TF=rnd*2\1
1817 ? TF,
1918 if TF then ? "It is true now."; else ? "Now it's false.";
2019 ?spc(3)+"press a key or click for next..."
2120next
2221for i=0 to -10 step -1 'they seem to behave the same for negatives too
2322 test=i+rnd
24- ? "test = ";test
25- ? "test\\1 " ;test\ \1
26- ? "int(test) ";int(test)
23+ ? " test = ";test
24+ ? " test\1 = " ;test\1
25+ ? "int(test) = ";int(test)
2726 ?
2827next
29- pause
30-
31- ~~~
28+ ```
3229
3330
You can’t perform that action at this time.
0 commit comments