Re: Passing floats/doubles to C

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

Todd Riggins writes:
> poke4(material,      atom_to_float64(1.0))
> poke4(material+8,  atom_to_float64(1.0))
> ...

atom_to_float64() returns a sequence of 8 bytes - a C double.
Use poke(material, atom_to_float64(1.0))
to store the 8 bytes in memory.
poke4 will actually store 4*8 = 32 bytes - wrong.

If you decide to use atom_to_float32() to store C *floats*,
you can also use poke() to store the 4 bytes.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu