Article View: comp.lang.c
Article #873Re: .5 against 0.5f
From: Steven G. Kargl
Date: Tue, 27 Oct 2026 19:54
Date: Tue, 27 Oct 2026 19:54
35 lines
2485 bytes
2485 bytes
On Tue, 27 Oct 2026 20:15:20 +0100, fir wrote: > Steven G. Kargl pisze: >> On Tue, 27 Oct 2026 18:50:09 +0100, fir wrote: >> >>> Steven G. Kargl pisze: >>>> On Tue, 27 Oct 2026 11:53:55 +0100, fir wrote: (snip) >>> but the question is: can using .1 instead of 0.1f make me any harm in >>> code? like things get slower in runtime? (assuming i use floats in >>> code not doubles, and the code is a bit time critical like >>> rasterisation goes on floats) why the ai so maniacally puts that f? >> >> Without seeing code and not knowing whether you are concerned with the >> propagation of floating point errors, the only answer that one can give >> for your first two questions is "yes, no, maybe". >> >> AI is likely appending the f because you instructed AI to use a float >> type. Why not ask AI why it appends the f? >> > it says: i add f that the number would be float type instead of double > > 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 > I do not know where to begin to address the above. Perhaps, find a copy of K&R to read. -- steve
Technical Details
Message-ID:
<11bqvh3$1qqsr$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> <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!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> Newsgroups: comp.lang.c Subject: Re: .5 against 0.5f Date: Tue, 27 Oct 2026 19:54:11 -0000 (UTC) Organization: A noiseless patient Spider Lines: 35 Message-ID: <11bqvh3$1qqsr$1@dont-email.me> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 27 Oct 2026 19:54:12 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1928091"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lS5SSc9jpz/mNF0rzvBKA"; posting-host="788ec41b747029f4d082e3468aec6752" User-Agent: Pan/0.164 (Kupiansk) Cancel-Lock: sha1:/vHE3WG7DanKUKavNarlvipGAm4= sha256:nF4b5I5GLMksgqR+G3d3D4IXpRuVRHl3aNwTeWA2MtY= sha1:8cL1xjZfCXsoWnGXZmm1Gp0lGb4= sha256:2FVeyZa04ULw0zoKmQWTz1cs8wyqHom4wliDqQXNw48=