10-31-2023, 01:49 AM
(10-31-2023, 01:37 AM)bplus Wrote:Try it again, but skip the floating point math (where division by zero is technically allowed). Do `20 \ a` and the program always explodes, since it gets evaluated before calling the `Iff$()` function.Code: (Select All)For a = -1 To 1
x = Val(Iff$(a <> 0, _Trim$(Str$(20 / a)), "0"))
Print x
Next
Function Iff$ (Bool&, true$, false$)
If Bool& <> 0 Then Iff$ = true$ Else Iff$ = false$
End Function