Files
pplus-library/pseudo/programs/51-ieee.pseudo
T
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

13 lines
560 B
Plaintext

// USE IEEE: NaN and the infinities flow through a calculation as IEEE 754 says, instead of stopping the run.
// EXPECT: infinity -infinity not a number
// EXPECT: TRUE TRUE FALSE TRUE
// EXPECT: not a number -infinity FALSE
USE IEEE
DECLARE Zero : FLOAT <- 0.0
DECLARE Inf : FLOAT
Inf <- 1.0 / Zero
DECLARE NotANumber : FLOAT <- Inf - Inf
OUTPUT Inf, " ", -Inf, " ", NotANumber
OUTPUT IS_INF(Inf), " ", IS_NAN(NotANumber), " ", NotANumber == NotANumber, " ", NotANumber != NotANumber
OUTPUT SQRT(-1.0), " ", LOG(0.0), " ", IS_FINITE(MAX_VALUE(FLOAT64) * 2.0)