Page 1 of 1

double floats in quickbms

Posted: Thu Jul 31, 2014 8:52 pm
by Chipicao
I have this script, big endianness if it matters:

Code: Select all

for i = 0 < VERTICES
   get VX longlong
   get VY longlong
   get VZ longlong
   get DUMMY long
   string VX p= "v %.16f " VX
   string VY p= "%.16f " VY
   string VZ p= "%.16f" VZ
   putCt VX string -1 MEMORY_FILE
   putCt VY string -1 MEMORY_FILE
   putCt VZ string -1 MEMORY_FILE
   put 0x0a0d short MEMORY_FILE
next i
But it doesn;t print the correct values. How am I supposed to do it?

Re: double floats in quickbms

Posted: Fri Aug 01, 2014 6:25 am
by Chipicao
I think I figured it out...

So first of all, quickbms only reads the integer part of floats?!
FLOAT 32 bit, 123.345 is got as 123
DOUBLE 64 bit, 123.345 is got as 123
And second, quickbms.exe can't read 64-bit numbers, and I have to use quickbms_4gb_files.exe.

Re: double floats in quickbms

Posted: Fri Aug 01, 2014 4:41 pm
by aluigi
yeah quickbms doesn't handle full floating point values because everything inside it is integer.
So when you use float/double as type of value, it saves only the integer part of the value.

Yes also for the second point, quickbms.exe uses 32bit integers and so reads a 64bit field but stores it inside a 32bit variable.
You must use quickbms_4gb_files to have full 64bit capabilities.

Re: double floats in quickbms

Posted: Sat Aug 02, 2014 10:45 am
by Chipicao
Is there any way for the script to check if quickbms_4gb_files.exe is used, something like quickbmsver?

Re: double floats in quickbms

Posted: Sat Aug 02, 2014 5:08 pm
by aluigi

Code: Select all

math TMP = 0x10000000
math TMP *= 16
if TMP == 0
    print "Error: you must use quickbms_4gb_files.exe for this archive"
    cleanexit
endif