Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <vq8eos$1ga7$1@gal.iecc.com>
Deutsch   English   Français   Italiano  
<vq8eos$1ga7$1@gal.iecc.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!news.iecc.com!.POSTED.news.iecc.com!not-for-mail
From: John Levine <johnl@taugh.com>
Newsgroups: alt.folklore.computers,comp.os.linux.misc
Subject: Re: evolution of arithmetic, was bytes, The joy of FORTRAN
Date: Wed, 5 Mar 2025 03:00:44 -0000 (UTC)
Organization: Taughannock Networks
Message-ID: <vq8eos$1ga7$1@gal.iecc.com>
References: <vpl91g$25q46$1@dont-email.me> <vq31t7$14njc$1@paganini.bofh.team> <vq36a6$cbc$3@gal.iecc.com> <vq86ej$23fck$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 5 Mar 2025 03:00:44 -0000 (UTC)
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
	logging-data="49479"; mail-complaints-to="abuse@iecc.com"
In-Reply-To: <vpl91g$25q46$1@dont-email.me> <vq31t7$14njc$1@paganini.bofh.team> <vq36a6$cbc$3@gal.iecc.com> <vq86ej$23fck$3@dont-email.me>
Cleverness: some
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: johnl@iecc.com (John Levine)

It appears that Pancho  <Pancho.Jones@protonmail.com> said:
>On 3/3/25 03:05, John Levine wrote:
>
>> That required simulating decimal
>> rounding with binary arithmetic, which was quite painful.  If DFP makes it
>> easier to get correct rounding on zillion dollar financial calculations it
>> could well be worth the cost.
>
>Why? Double precision gives you 15 digits. 

It's not just having enough precision, it's getting the decimal rounding to do
the right thing with whatever number of digits the spec says. Sometimes it's
pennies, two digits after the decimal point, but sometimes it's something like
the the nearest 1/100 of a percent which would be four digits after the decimal
point.

For financial calculations, the right answer often isn't the mathematically most
accurate one, it's the one that agrees with the result that all the other people
doing financial calculations get. In some cases like bond pricing the formulas
date back to the 1920s or 1930s and were designed to be tractable with pencil
and paper or a mechanical desk calculator. They often have strange
simplifications like pretending every month has 30 days and the year has 360
days. They're defined in terms of decimal arithmetic, which is why DFP, which
unlike BFP lets you say how many digits you want to keep, is useful.



-- 
Regards,
John Levine, johnl@taugh.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly