atavera
10-12-2006, 06:09 AM
I'm working on an Import/Export, got the import done, but WriteLong is rounding off numbers and thus writing the wrong numbers :\
ex.
WriteLong bstream 0xFFFF0001
gets read as an int first and rounds the number down
and writen to the stream as 0xFFFF0000
I can get around this by writing two shorts, but it seems kinda screwy as I could read it as a Long on the importer(well with bit.intAsHex). It would make sense to me that if there is a function to write long integers that it could write them up to 0xFFFFFFFF accurately. Is there any way around this other than splitting these into shorts?
Edit: Nevermind, just made a seperate function for writing long ids.
ex.
WriteLong bstream 0xFFFF0001
gets read as an int first and rounds the number down
and writen to the stream as 0xFFFF0000
I can get around this by writing two shorts, but it seems kinda screwy as I could read it as a Long on the importer(well with bit.intAsHex). It would make sense to me that if there is a function to write long integers that it could write them up to 0xFFFFFFFF accurately. Is there any way around this other than splitting these into shorts?
Edit: Nevermind, just made a seperate function for writing long ids.
