fractional code


Closed Thread
Results 1 to 3 of 3

Thread: fractional code

  1. #1
    Join Date
    Nov 2015
    Posts
    13

    Default fractional code

    Excuse me for it is an elementary item.
    I have to divide a pair of two digit integers and handle the result (decimal with fraction) just two digits fractional. Then multiply this last with a percentage.
    I know one have to scale and descale, but if somebody have a simmilar simple code for this simple example, I'd be very grateful if you share it just for saving time. (Time is life, so it is not a little thing)

  2. #2
    Join Date
    Nov 2015
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: fractional code

    I can't use div32 because I'm using pbpl

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: fractional code

    Just multiply the 2 variables by 100 to begin with then do the division. That way you have 2 decimal places in the result.
    Dave Purola,
    N8NTA
    EN82fn

Similar Threads

  1. avr code to code for PIC
    By JasonMcG in forum General
    Replies: 1
    Last Post: - 11th September 2014, 01:57
  2. Serial problem between BasicStamp code and PBP code
    By AllanZilkowsky in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 6th April 2014, 03:15
  3. Working code but my layman approach uses too much code space
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th December 2012, 21:44
  4. Code: Why is this code greater than 2000 words?
    By DrDreas in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 1st June 2007, 20:51

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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