float init 0 request

Walter Bright newshound2 at digitalmars.com
Fri Aug 21 18:20:35 UTC 2026


On 8/20/2026 7:36 PM, Steven Schveighoffer wrote:
> This contrived almost impossible to occur scenario where zero somehow equates to 
> a factor of 2000 which was not caught in testing is not convincing.

I've written numerical analysis programs. One has to be very careful with the 
math, because small roundoff errors can accumulate to very large errors.

Avionics software does get tested very thoroughly. But problems still happen, 
including ones that have caused crashes.


> I can play too:
> 
> ```d
> if(gas < amountNeeded) warnPilot();
> ```

Not really. The avionics gives a number of how much gas needs to be put in the 
tanks. See this case study:

"Air Canada Flight 143 ran out of fuel because of a metric unit conversion 
error. Ground crews calculated the required fuel load in pounds instead of 
kilograms for a brand-new Boeing 767, loading less than half the necessary fuel. 
This mistake was compounded by a malfunctioning fuel gauge system that had been 
cleared for departure, leaving the crew unaware they were flying with empty 
tanks until both engines quit at 41,000 feet."

https://en.wikipedia.org/wiki/Gimli_Glider


More information about the Digitalmars-d mailing list