Memory Block

BlitzMax Forums/BlitzMax Programming/Memory Block

Ok, I just coded up a small sample:

Global pointer:Byte Ptr
pointer = MemAlloc( 255 )
MemClear( pointer, 255 )
pointer[0] = Int( 123 )
pointer[2] = Float( 1.45 )

This compiles and appears to be working. The problem is that as the float is placed into the memory location it is cast to a byte and therefore loses all precision.

Is there anyway around this. I realy dont want to resort to fixed point numbers for speed reasons.

Perhaps im just indexing the memory wrong for my read/write opperations.

Thanks