float init 0 request
claptrap
clap at trap.com
Fri Aug 21 21:24:21 UTC 2026
On Friday, 21 August 2026 at 18:20:35 UTC, Walter Bright wrote:
> 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.
That's only a problem with recursive algorithms, you have to feed
the error back in, IE positive feedback. It's why IIR filters can
blow up and FIR filters cant.
I mean if you have 1000 sensors sending you data, and you sum
them all up, the relative error will not be any worse than the
average of the individual sensors.
So I don't see how that saves your fuel levels analogy, for one
how complicated is it to calculate fuel levels? You're just not
doing enough math and why would you need anything recursive in
there. So it fails on two counts.
There's literally no plausible reason that "error build-up" could
cause the hypothetical situation you described.
>> 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
How do NaNs stop the ground crew from mixing up Lbs and Kgs, and
how does it detect a malfunctioning fuel gauge? Googling says
this was 1983, so probably a mechanical gauge?
More information about the Digitalmars-d
mailing list