setting values and percentages


Results 1 to 38 of 38

Threaded View

  1. #21
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: setting values and percentages

    What is the relationship between numx and x?
    poor typing
    if you have a word var say numx
    and numx =4095
    then 50*numx/100 the result is 81
    the word var causes a intermediate stage overflow (bits 0-15 of 204750 =8142)
    I still say integer math is tricky and results need to be double checked

    intermediate overflow
    50*4095 =204750 max value for word 65535 therefore an overflow occurs and the result becomes 8142
    Last edited by richard; - 3rd July 2014 at 10:44. Reason: more info

Similar Threads

  1. POT part values
    By Michael in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th January 2009, 10:41
  2. Port Values
    By Pesticida in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd January 2007, 20:44
  3. t in POT, c's values
    By selbstdual in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 24th August 2006, 23:30
  4. Numeric Values
    By Armando Herjim in forum General
    Replies: 8
    Last Post: - 28th June 2006, 01:54
  5. Wrong values with COSINE!
    By Eng4444 in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 8th May 2006, 16:59

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