Article View: comp.lang.c
Article #1108Re: .5 against 0.5f
From: makendo
Date: Thu, 29 Oct 2026 10:04
Date: Thu, 29 Oct 2026 10:04
16 lines
1899 bytes
1899 bytes
> I ordered a couple of blu-rays from amazon last week, and the > confirmation email had the following for the total price: > > Total > 75.71000000000001 USD > > Appears they may be using FP instead of integer fixed point arithmetic > for pricing. And this is why you should use the lowest value denominator when storing monetary values -- store USD values in cents, CNY values in fen, EUR values in cents, etc... I envy in particular the Japanese on this -- they don't have monetary units smaller than 1 yen, and as such misuse of floats in monetary calculations are far less likely in Japan.
Technical Details
Message-ID:
<11bv5o7$37qph$1@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-mailReferences:
<11bpvs7$1e6kc$2@dont-email.me> <11bqnvh$1np7s$1@dont-email.me> <Ue6ES.2265$y_V1.1859@fx12.iad>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: makendo <makendo@makendo.invalid> Newsgroups: comp.lang.c Subject: Re: .5 against 0.5f Date: Thu, 29 Oct 2026 18:04:52 +0800 Organization: A noiseless patient Spider Lines: 16 Message-ID: <11bv5o7$37qph$1@dont-email.me> References: <11bpvs7$1e6kc$2@dont-email.me> <11bqnvh$1np7s$1@dont-email.me> <Ue6ES.2265$y_V1.1859@fx12.iad> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 29 Oct 2026 10:04:56 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3402545"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QKZe0Flb0ZXvYUkVUDu1N"; posting-host="ce5ad6f8e30d93434bd7e5448375f347" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:TycrZRLYo/Q2NZGH39suSq0rE84= sha256:8U00Ah/FXNd23aYXY9mOVIt2cp/M6lW6h3+rN3zlxqQ= sha1:DX+tf4Owb1NewywgP6t01iDxLsI= sha256:LhOrsGQm/1jnk3gPrdfYCs2XTrHeJHIiF259LRAJFB8= Content-Language: en-US In-Reply-To: <Ue6ES.2265$y_V1.1859@fx12.iad>