Getting out of floating point


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2008
    Posts
    5

    Default Getting out of floating point

    I was wondering if anybody knows of a way to do this calculation without a floating point co processor.

    (6.67*10-11)(50)(75)/(0.5)(0.5)

    Any input would be greatly appreciated.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jcb344 View Post
    I was wondering if anybody knows of a way to do this calculation without a floating point co processor.
    (6.67*10-11)(50)(75)/(0.5)(0.5)
    Obviously, you can't do fractions with PBP...

    6.67 - I assume this is 6 and 2/3 - is the same as 20 / 3

    10-11 - I assume this is actually 10^-11, ten raised to the -11 power, can't really do anything with that in PBP other than keep track of the decimal point manually somewhere else.

    .5 - a .5 divisor (on the bottom) is the same as a 2 dividend (on the top)

    So, here's what I've got...

    ( 20 ) ( 50 ) ( 75 ) ( 2 ) ( 2 ) / 3
    The 20 from multiplying up the 6.67
    The 10-11 is kept somewhere else
    The 50 and 75 are kept as usual
    The 2's are from the .5's on the bottom
    The 3 is from multiplying up the 6.67

    So I get 100,000^-11 or 1^-5

    Not PBP friendly at all...

    What exactly is the root problem here?

  3. #3
    Join Date
    Jul 2008
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    You got it right 6.67*10-11 is suppose to be 6.67*10^-11. I am attempting to create a particle simulation based on gravity between two partials. This involves using the simple gravity equation F = GMm/RČ. Where G = 6.67*10^-11. No this defiantly is not a picbasic friendly problem but it would be really cool if I could get this working because I could then easily scale this up to a large scale simulator. Cold anybody suggest a more user friendly floating point co-processor than the pricey uM-FPU, or a better way of going about this equation in code?

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

Similar Threads

  1. Floating point math
    By Glenn in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th January 2009, 03:47
  2. Floating Point Display Problem (serial string out)
    By Cash Olsen in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th December 2007, 02:03
  3. Microchip Floating Point Routines
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th October 2006, 19:51
  4. ADCin and floating point values
    By niknaksbarbeque in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th May 2005, 11:38
  5. Floating Point
    By jrudd in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th May 2005, 14:19

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