Floating point - please enlighten me!


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    You could simplify your math to make it easier for the Picbasic commands.

    Since you have:

    Temp = ADC10 * ((ADC10 * .00034) + .2235)


    Why don't we get rid of that ugly .00034
    1/.00034 = 2941

    So we multiply both sides by 2941 ...

    Temp * 2941 = ADC10 * (ADC10 + 657)


    Then lets divide both sides by 2941 ...

    Temp = (ADC * (ADC10 + 657)) / 2941

    Then you can use div32

    Code:
    dummy = ADC10 * (ADC10 + 657)
    Temp = div32 2941
    And I think the result is close enough...
    Last edited by ScaleRobotics; - 25th November 2010 at 17:49.
    http://www.scalerobotics.com

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts