The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
(12C) Banker's Rounding Method
11-27-2018, 05:31 AM
Post: #1
(12C) Banker's Rounding Method
The banker's rounding method involves rounding numeric amounts to the nearest integer. When the number ends in 0.5 (1.5, 3.5, 8.5, etc), special rules apply:

The decimal gets rounded to the nearest even integer. For example: 0.5, 2.5, and 4.5 round down to 0, 2, and 4 respectively. However, 1.5, 3.5, and 5.5 are rounded up to 2, 4, and 6 respectively.

Code:
001  STO 0
002  INTG
003  STO 1
004  LSTx  
005  FRAC
006  STO 2
007   .
008  5
009   -
010   x=0
011   GTO 018
012   RCL 0
013   FIX 0
014   RND
015   STO 4
016   FIX 2
017   GTO 000
018   RCL 1 
019   2
020   รท
021   FRAC
022   x=0
023   GTO 029
024   RCL 1
025   1
026   +
027   STO 4
028   GTO 000
029   RCL 1
030   STO 4
031   GTO 000

Original blog post: https://edspi31415.blogspot.com/2018/11/...nkers.html
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(12C) Banker's Rounding Method - Eddie W. Shore - 11-27-2018 05:31 AM



User(s) browsing this thread: 2 Guest(s)