Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
47
Task/Infinity/M2000-Interpreter/infinity.m2000
Normal file
47
Task/Infinity/M2000-Interpreter/infinity.m2000
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
Rem : locale 1033
|
||||
Module CheckIt {
|
||||
Form 66,40
|
||||
Cls 5
|
||||
Pen 14
|
||||
\\ Ensure True/False for Print boolean (else -1/0)
|
||||
\\ from m2000 console use statement Switches without Set.
|
||||
\\ use Monitor statement to see all switches.
|
||||
Set Switches "+SBL"
|
||||
IF version<9.4 then exit
|
||||
IF version=9.4 and revision<25 then exit
|
||||
Function Infinity(positive=True) {
|
||||
buffer clear inf as byte*8
|
||||
m=0x7F
|
||||
if not positive then m+=128
|
||||
return inf, 7:=m, 6:=0xF0
|
||||
=eval(inf, 0 as double)
|
||||
}
|
||||
K=Infinity(false)
|
||||
L=Infinity()
|
||||
Function TestNegativeInfinity(k) {
|
||||
=str$(k, 1033) = "-1.#INF"
|
||||
}
|
||||
Function TestPositiveInfinity(k) {
|
||||
=str$(k, 1033) = "1.#INF"
|
||||
}
|
||||
Function TestInvalid {
|
||||
=str$(Number, 1033) = "-1.#IND"
|
||||
}
|
||||
Pen 11 {Print " True True"}
|
||||
Print TestNegativeInfinity(K), TestPositiveInfinity(L)
|
||||
Pen 11 {Print " -1.#INF 1.#INF -1.#INF 1.#INF -1.#INF 1.#INF"}
|
||||
Print K, L, K*100, L*100, K+K, L+L
|
||||
M=K/L
|
||||
Pen 11 {Print " -1.#IND -1.#IND True True" }
|
||||
Print K/L, L/K, TestInvalid(M), TestInvalid(K/L)
|
||||
M=K+L
|
||||
Pen 11 {Print " -1.#IND -1.#IND -1.#IND True True"}
|
||||
Print M, K+L, L+K, TestInvalid(M), TestInvalid(K+L)
|
||||
Pen 11 {Print " -1.#INF 1.#INF"}
|
||||
Print 1+K+2, 1+L+2
|
||||
Pen 11 {Print " -1.#INF"}
|
||||
Print K-L
|
||||
Pen 11 {Print " 1.#INF"}
|
||||
Print L-K
|
||||
}
|
||||
Checkit
|
||||
Loading…
Add table
Add a link
Reference in a new issue