TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: THE NATURAL PHILOSOPHER
from: MARTIN GREGORIE
date: 2021-01-04 11:33:00
subject: Re: USB card adapters cra

On Mon, 04 Jan 2021 03:17:27 +0000, The Natural Philosopher wrote:

> On 03/01/2021 19:15, Charlie Gibbs wrote:
>> On 2021-01-03, Joe  wrote:
>>
>>> On Sun, 03 Jan 2021 15:41:04 GMT Jan Panteltje
>>>  wrote:
>>>
>>>>   I use an asm math library written by someone else,
>>>> so far 32 bit integer was all I needed,
>>>
>>>   "If you need to use floating-point arithmetic in FORTH,
>>>   you do not fully understand your application"
>>>
>>> Not sure if it was Charles Moore or Leo Brodie who said that.
>>
>> It makes sense, though, depending on your applications.
>> In 50 years of commercial programming, I can count the number of times
>> I've used floating point on the fingers of one hand.
>>
> Odd. I use it extensively. Not for money oriented stuff tho

Not that odd: in a 30 year IT career (system design, programming,
sysadmin, much of it databases and finance-related systems) I can only
think of one survey analysis program I wrote, in Algol 60, that used
floating point (and that was for a one-off task).

Financial systems never use floating point for accuracy reasons:
consequently integers are used to hold currency amounts: sterling amounts
are held as pence, euros and dollars as cents and the equivalent
convention is used for all other currencies. The only exception I'm aware
of was financial packages written in BASIC for early microcomputers, and
that was only because (a) integers tended to be 16 bits at most and (b)
their PRINT statements often couldn't interpolate a decimal point when
displaying an integer value.

OTOH COBOL was designed from the outset to deal with currency amounts
held as integers:

77 INVOICE-TOTAL   PIC £99,999,990.00CR COMP SYNC BLANK WHEN ZERO.

might look as if its floating point but, the variable would be a 32 bit
signed integer which would be read or written as a string containing the
currency sign, possibly containing comma separators and with a decimal
point separating pounds from pence.

RPG (UGH!) does the same and all modern languages (and assemblers) have
sufficiently powerful number scanning and formatting library functions to
do the same.


--
--
Martin    | martin at
Gregorie  | gregorie dot org

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.