PRINT SIN 1
Gives: 0.841461181640625 (wrong)
LET v = 1
PRINT SIN v
Gives: 0.84147098 (right)
Gives: 0.841461181640625 (wrong)
LET v = 1
PRINT SIN v
Gives: 0.84147098 (right)
Wrong math

PRINT SIN 1
Gives: 0.841461181640625 (wrong) LET v = 1 PRINT SIN v Gives: 0.84147098 (right)
11122023, 05:46 PM
They are actually the same value. It's a matter of precission.
SIN 1 is being calculated directly by the compiler in compiling time. SIN(1) is aprox 0.8414709848078965 The 2nd case is computed in runtime, using the ROM calculator. I guess this is due to a bug in precision converting from PC to ZX Spectrum 5 bytes format. Will investigate this and keep you posted. Thanks 
« Next Oldest  Next Newest »
