1. Poking decimals

How do you go about poking decimals into memory?  I just need about 3 
decimal places of precision.

new topic     » topic index » view message » categorize

2. Re: Poking decimals

Oh, duh.  Thanks for your help, again.



Brian Broker wrote:
> 
> 
> Floating point representation?
> use atom_to_float32() or atom_to_float64()
> 
> -- Brian
> 
> 1evan wrote:
> 
>>
>>How do you go about poking decimals into memory?  I just need about 3 
>>decimal places of precision.
>>
>>
> 
> 
> TOPICA - Start your own email discussion group. FREE!
> 
>

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

3. Re: Poking decimals

Using poke4(address, number*1000) and (peek4s(address)/1000) will get you
a fixed precision of 3 decimal places, at the cost of reducing the whole
number part of the decimal by the 3 uppermost decimal places that a 32bit number
can represent ... you probably don't need to worry about this, and if you do
then you are better off using 64bit floating point instead of fixed precision.

jbrown

1evan wrote:

>How do you go about poking decimals into memory?  I just need about 3 
>decimal places of precision.

-- 
 /"\  ASCII ribbon              | http://www.geocities.com/jbrown1050/
 \ /  campain against           | Linux User:190064
  X   HTML in e-mail and        | Linux Machine:84163
 /*\  news, and unneeded MIME   | http://verify.stanford.edu/evote.html

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

4. Re: Poking decimals

That makes a heck of a lot of sense.  I think my brain is on an extended 
vacation.  The built-in atom_to_float32 works wonderfully, too. (Thanks 
Brian Broker)

Thanks for the suggestion.  I should probably go to bed now, but I'm 
having too much fun!


jbrown105 at speedymail.org wrote:
> 
> 
> Using poke4(address, number*1000) and (peek4s(address)/1000) will get you
> a fixed precision of 3 decimal places, at the cost of reducing the whole
> number part of the decimal by the 3 uppermost decimal places that a 32bit
> number
> can represent ... you probably don't need to worry about this, and if you do
> then you are better off using 64bit floating point instead of fixed precision.
> 
> jbrown
> 
> 1evan wrote:
> 
> 
>>How do you go about poking decimals into memory?  I just need about 3 
>>decimal places of precision.
> 
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu