Einzelnen Beitrag anzeigen

Der schöne Günther

Registriert seit: 6. Mär 2013
6.176 Beiträge
 
Delphi 10 Seattle Enterprise
 
#8

AW: Warum kommt bei Gleitkommadivision durch 0 eine Exception?

  Alt 30. Mai 2017, 15:59
Delphi weicht hier, wie so oft, vom Standard ab. In vielen Anwendungen haben wir die FPU-Exceptions abgeschaltet.

Windows:
Zitat:
By default, the system has all FP exceptions turned off. Therefore, computations result in NAN or INFINITY, rather than an exception.
(Quelle)

GNU C:
Zitat:
By default the exception is simply noted in the floating-point status word, and the program continues as if nothing had happened. The operation produces a default value, which depends on the exception [...]
(Quelle)

IEE 754 höchstselbst:
Zitat:
The 754 model encourages robust programs. It is intended not only for numerical analysts but also for spreadsheet users, database systems, or even coffee pots. The propagation rules for NaNs and infinities allow inconsequential exceptions to vanish. Similarly, gradual underflow maintains error properties over a precision's range.

When exceptional situations need attention, they can be examined immediately via traps or at a convenient time via status flags. Traps can be used to stop a program, but unrecoverable situations are extremely rare.
(Quelle)

Und:
Zitat:
IEEE 754 specifies trapping as an optional feature, required to be off by default, which
has been interpreted by C99 and Java to mean that IEEE 754 deprecates trapping as a
method of diagnosing errors.
(Quelle)

Auch in letzter Zeit sind "neuere" Sprachen wie Java und C# genau diesen Weg gegangen. Nur Delphi ist da wieder anders.
  Mit Zitat antworten Zitat