OT: floats

Quirin Schroll qs.il.paperinik at gmail.com
Wed Jun 12 13:25:23 UTC 2024


On Sunday, 9 June 2024 at 17:54:38 UTC, Walter Bright wrote:
> On 5/26/2024 1:05 AM, Daniel N wrote:
>> I was aware of `-ffast-math` but not that the seemingly 
>> harmless enabling of gnu dialect extensions would change 
>> excess-precision!
>
> Supporting various kinds of fp math with a switch is just a bad 
> idea, mainly because so few people understand fp math and its 
> tradeoffs. It will also bork up code that is carefully tuned to 
> the default settings.

Every once in a while, I believe floating-point numbers are such 
delicate tools, they should be disabled by default and require a 
compiler switch to enable. Something like 
`--enable-floating-point-types--yes-i-know-what-i-am-doing-with-them--i-swear-i-read-the-docs`. And yeah, this is tongue in cheek, but I taught applied numerics and programming for mathematicians for 4 years, and even I get it wrong sometimes. In my work, we use arbitrary precision rational numbers because they’re fool-proof and we don’t need any transcendental functions.


More information about the dip.development mailing list