LoginLogin
Might make SBS readonly: thread

GSAVE behaves differently with int and float arrays

Root / SmileBASIC Bug Reports / [.]

12Me21Created:
GSAVE saves signed 32 bit values in integer arrays, but UNSIGNED 32 bit when a float array is used.
GCLS #WHITE
DIM FLOAT#[0],INT%[0]
GSAVE 0,0,1,1,INT%,0
GSAVE 0,0,1,1,FLOAT#,0
?INT%[0] '-460552 (#WHITE)
?FLOAT#[0] '4294506744
?HEX$(INT%[0]) 'FFF8F8F8
?HEX$(FLOAT#[0]) 'overflow error

hmmmm somebody didnt cast a type correctly or something always type your vars properly kids.

Technically speaking, I don't think GSAVE behaves differently per se, I think it just always writes the unsigned values, which become signed due to overflow with int arrays.