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 
(42S) Integer Quotient
09-19-2017, 06:38 AM
Post: #1
(42S) Integer Quotient
For large input, eg 888,888,888,888 the 42S snippet

5 / IP

does not return the correct integer quotient.

I have a programme to do the calculation correctly without disturbing the stack but believe it is inefficient.

Could someone suggest a more efficient programme that leaves the stack intact?

Code:
0.    { 29-Byte Prgm }
 1.    LBL “IQT5”
 2.    R↑
 3.    STO 01
 4.    R↓
 5.    STO 02
 6.    5
 7.    MOD
 8.    +/-
 9.    RCL+ 02
 10.    5
 11.    /
 12.    R↑
 13.    X<> 01
 14.    R↓
 15.    END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(42S) Integer Quotient - Gerald H - 09-19-2017 06:38 AM
RE: (42S) Integer Quotient - Werner - 09-19-2017, 07:45 AM
RE: (42S) Integer Quotient - Gerald H - 09-19-2017, 08:46 AM
RE: (42S) Integer Quotient - Werner - 09-19-2017, 11:20 AM
RE: (42S) Integer Quotient - Gerald H - 09-19-2017, 12:09 PM
RE: (42S) Integer Quotient - grsbanks - 09-20-2017, 10:17 AM
RE: (42S) Integer Quotient - Gerald H - 09-20-2017, 12:08 PM



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