1. strangeness with float32_to_atom()?

anistropic_avail = allocate(4) 
poke(anistropic_avail, atom_to_float32(13.5))	 
anis_ret = float32_to_atom({anistropic_avail, anistropic_avail+1, anistropic_avail+2, anistropic_avail+3})	 
writetofile(sprintf("Anistropic Max Samples:  [%.1f]\n\n", anis_ret), ZA_MISC)	 

Shouldnt this write out 13.5 or am I doing something wrong?

Result: Anistropic Max Samples: [0.0]

Thanks! Steve A.

new topic     » topic index » view message » categorize

2. Re: strangeness with float32_to_atom()?

ssallen said...
anistropic_avail = allocate(4) 
poke(anistropic_avail, atom_to_float32(13.5))	 
anis_ret = float32_to_atom({anistropic_avail, anistropic_avail+1, anistropic_avail+2, anistropic_avail+3})	 
writetofile(sprintf("Anistropic Max Samples:  [%.1f]\n\n", anis_ret), ZA_MISC)	 

Shouldnt this write out 13.5 or am I doing something wrong?

Result: Anistropic Max Samples: [0.0]

You need to peek the bytes from memory:

anis_ret = float32_to_atom( peek( anistropic_avail & 4) ) 

Matt

new topic     » goto parent     » topic index » view message » categorize

3. Re: strangeness with float32_to_atom()?

argh. I knew better then that. The sad part is that I have been staring at that dumbfounded for 45 minutes.

Thanks, Steve A.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu