Incorrect calculations... please help.


Results 1 to 4 of 4

Threaded View

  1. #2
    Join Date
    Aug 2005
    Location
    Vermont
    Posts
    15


    Did you find this post helpful? Yes | No

    Default calculations

    Let's do the math....
    GalUse = 1600 - 1475 'which equals 125, this is fine

    MPG = 3280/125 'which equals 26.24 and the .24 is lost because PBP doesn't handle floating point. Therefore in your debug statement MPG/100 is equal to 26/100 which is less than 0 and is displayed as 0. DEC2 MPG displays 26 which is correct.

    Peter
    Last edited by Mith; - 29th January 2007 at 18:36.

Similar Threads

  1. Incorrect adc channel bits generated
    By grahamg in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th February 2010, 18:56
  2. DS1307 returns incorrect data ???
    By gtvmarty in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 8th October 2009, 09:54
  3. clock/timer calculations
    By virolay in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th January 2008, 20:20
  4. Calculations for using faster Clocks.
    By Tissy in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th April 2005, 14:24
  5. timing calculations
    By scorpion in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th November 2004, 22:58

Members who have read this thread : 0

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