adccommunitymod (AutomationDirect) asked a question.

Help With Division...

Created Date: December 05,2002

Created By: Guest

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

Is there an easy way of getting digits to the right of the decimal point when a division results in decimals? The one way to do it is to multiply by 100 (for 2 decimal places), get the numbers, then subtract then divide then.... Is there an Easier method ?


  • adccommunitymod (AutomationDirect)

    Created Date: December 05,2002

    Created by: Guest

    Is there an easy way of getting digits to the right of the decimal point when a division results in decimals?

    The one way to do it is to multiply by 100 (for 2 decimal places), get the numbers, then subtract then divide then....

    Is there an Easier method ?

  • adccommunitymod (AutomationDirect)

    Created Date: December 05,2002

    Created by: bcarlton

    The answer depends on what you want to do with the digits. Are you using a CPU capable of REAL math? For ordinary (BCD and Binary) division, the REMAINDER remains on the stack and can be retreived (after perhaps saving the quotient) with a POP command.