Article View: comp.lang.c
Article #1169Re: .5 against 0.5f
From: Scott Lurndal
Date: Fri, 30 Oct 2026 13:55
Date: Fri, 30 Oct 2026 13:55
30 lines
2304 bytes
2304 bytes
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes: >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.) All the early electrodata/burroughs business computers (Datatron 220, Burroughs B300, Burroughs B3500) used fixed point BCD representations for business applications and the COBOL compiler. > >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.) Simply using %8.2f would have been sufficient, but modern programmers don't like printf formatting, apparently.
Technical Details
Message-ID:
<1l1FS.54006$%ZO1.20684@fx13.iad>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx13.iad.POSTED!not-for-mailReferences:
<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> <11c14qg$2t866$7@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!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx13.iad.POSTED!not-for-mail X-newsreader: xrn 9.03-beta-14-64bit Sender: scott@dragon.sl.home (Scott Lurndal) From: scott@slp53.sl.home (Scott Lurndal) Reply-To: slp53@pacbell.net Subject: Re: .5 against 0.5f Newsgroups: comp.lang.c 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> <11c14qg$2t866$7@dont-email.me> Lines: 30 Message-ID: <1l1FS.54006$%ZO1.20684@fx13.iad> X-Complaints-To: abuse@usenetserver.com NNTP-Posting-Date: Fri, 30 Oct 2026 13:55:09 UTC Organization: UsenetServer - www.usenetserver.com Date: Fri, 30 Oct 2026 13:55:09 GMT X-Received-Bytes: 2070