🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #918

Re: .5 against 0.5f

#918
From: steve g
Date: Wed, 28 Oct 2026 06:19
38 lines
2407 bytes
fir <profesor.fir@gmail.com> writes:


> float x=a*1.5;
>
> it also says in such above case the multiplication would be in double then
> converted to float - bout for me its hard to belive

you could use ratios.

> (i some cases ai not quite tells the truth and i cant easily validate it)

Hahha... TMS?

> it also not gives stright answe if pushed - it says more liek id depends on
> flags, compiler may or may
>
> so this is no good answer

Welcome to programming :)

> (and i asume there may be soem simple answer here i dont know
> (and i suspect its rather - no it will generate float no silly conversions

Unlikely.

> if no that would be bad)

Try lisp, you can use fractions, ratios, very large doubles. It is
somewhat slow with floating point usually. Ratios I like.  1/100 - that
is it.

If you want real speed with numbers I would look into fortran (actually
I would not).

 -> (numerator (/ 1 100)) => 1
 -> (denominator (/ 1 100) => 100
Technical Details
Message-ID: <87o6ceny8j.fsf@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!69.80.99.22.MISMATCH!border-4.nntp.ord.giganews.com!nntp.giganews.com!local-2.nntp.ord.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
References: <11bpvs7$1e6kc$2@dont-email.me> <11bqnvh$1np7s$1@dont-email.me> <11bqo8h$1o2l4$2@dont-email.me> <11bqsef$1pnhi$1@dont-email.me> <11bqt88$1q9r2$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!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!69.80.99.22.MISMATCH!border-4.nntp.ord.giganews.com!nntp.giganews.com!local-2.nntp.ord.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 28 Oct 2026 06:19:25 +0000
From: steve g <Sgonedes1977@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: .5 against 0.5f
References: <11bpvs7$1e6kc$2@dont-email.me> <11bqnvh$1np7s$1@dont-email.me> <11bqo8h$1o2l4$2@dont-email.me> <11bqsef$1pnhi$1@dont-email.me> <11bqt88$1q9r2$1@dont-email.me>
Date: Wed, 28 Oct 2026 02:19:24 -0400
Message-ID: <87o6ceny8j.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:/0FH51Ke6pwH4bnCVqEyajbJ098=
MIME-Version: 1.0
Content-Type: text/plain
Lines: 38
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-qDJliCLc1i6ZHU/L/5M4N8oBPvhskmH1mS3YV0eeO5S/PH640y63R5kKCEh7jywNy7dnz76Kewk4duh!JW9Sw47+Yida7TgOZ2zp+USgbrIJj3m5mD66o4ideL09J0I=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40