RE: Writing 64-bit numbers to memory

new topic     » topic index » view thread      » older message » newer message

> From: Jonas Temple [mailto:jktemple at yhti.net]

> All,
> 
> I know how to get a 64-bit number:
> 
> peek4u(mem) + (peek4u(mem+4) * power(2,32))
> 
> But how do you put a 64-bit number?

This should work:

a = peek4u(mem) + (peek4u(mem+4) * power(2,32))
poke4( mem, a )
poke4( mem + 4, floor(a * power( 2, -32 )) )

Of course, if your number is bigger than 2^52, you'll lose precision, since
that's how big the mantissa is for 64-bit fp numbers.

Matt Lewis

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu