🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1151

Re: .5 against 0.5f

#1151
From: Janis Papanagnou
Date: Fri, 30 Oct 2026 04:01
23 lines
2339 bytes
On 2026-10-30 01:50, Lawrence D’Oliveiro wrote:
> [...]
> 
> How would you do calculations involving compound interest payments
> without floating-point arithmetic? And why would you want to?

Because what gets in and what comes out is just exact fixed point?
And you need more an exact transformation to and from the internal
values? And exact representation with BCD more than binary floating
point? (Mind the 0.10 issue!) - I think there was a reason why with
COBOL, the COmmon Business Oriented Language, there was - at least
historically - fixed-point arithmetic used for the financial sector?
(But please CMIIW.)

Would there be a problem with fixed-point arithmetic (that internally
uses a few more than just two decimals for rounding etc.) but that is
using basically a fixed-point representation?

And we saw in some post this hilarious sample of an (Amazon?) bill.
(Not that this couldn't have been fixed even/also with FP-arithmetic.)

Janis
Technical Details
Message-ID: <11c14qg$2t866$7@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11bpvs7$1e6kc$2@dont-email.me> <11bqnvh$1np7s$1@dont-email.me> <Ue6ES.2265$y_V1.1859@fx12.iad> <11bv5o7$37qph$1@dont-email.me> <11c0plh$3s02c$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.lang.c
Subject: Re: .5 against 0.5f
Date: Fri, 30 Oct 2026 05:01:20 +0100
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <11c14qg$2t866$7@dont-email.me>
References: <11bpvs7$1e6kc$2@dont-email.me> <11bqnvh$1np7s$1@dont-email.me>
 <Ue6ES.2265$y_V1.1859@fx12.iad> <11bv5o7$37qph$1@dont-email.me>
 <11c0plh$3s02c$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 30 Oct 2026 04:01:21 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3055814"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/PXMH6nigN/49i5FIemkGN"; posting-host="0fda1f313dd998dda8e95c4840e29ea0"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:1dLdjPz7rEulZqbnI+/Mzf7DfvI= sha256:/M/Wuf3bK6mwPrKnmOMlRBpOGI+D0+SIVg94KC/JPFo=
	sha1:6jwof3/GseEbowe5GNyOQWG6ASo= sha256:OPn5hinr8qZ+RoMa4dxb09zerUB8X67mEHOCDNi42xg=
In-Reply-To: <11c0plh$3s02c$1@dont-email.me>
Content-Language: en-US