Re: Division durch Null
- From: Markus Wichmann <nullplan@xxxxxxx>
- Date: Tue, 8 Sep 2009 11:18:18 +0200
Roland Damm <roland-damm@xxxxxxxx> wrote:
Moin,
Thomas Richter schrub:
Bei IEEE-Fließkommazahlen für eine FPU wie vom OP angefragt?
Eher nicht. Da gibt es INF, um diesen Zustand auszudrücken...
IMO gibt es nicht nur INF, sondern sogar +/- INF und NAN.
Division durch Null ist dann eher ein Kandidat für NAN, weil ja
das Vorzeichen von INF nicht bekannt ist.
CU Rollo
Ach ja? Auch wenn es fachfremd ist, aus dem AMD64 Architecture
Programmer's Manual Volume 5: 64-Bit Media and x87- Floating-Point
Instructions, Abschnitt über fdiv:
|If the zero-divide exception is not masked (ZM bit cleared to 0 in the
|x87 control word) and the operation causes a zero-divide exception (sets
|the ZE bit in the x87 status word to 1), the operation stores no result.
|If the zero-divide exception is masked (ZM bit set to 1), a zero-divide
|exception causes "infinity" to be stored.
|
|The sign of the operands, even if one of the operands is 0, determines
|the sign of the result.
Noch Fragen?
Also: +finite/+0 = +infinity
+finite/-0 = -infinity
-finite/+0 = -infinity
-finite/-0 = +infinity
Und "finite" schließt 0 mit ein. Das IEEE-754-Floating-Point-Format
funktioniert halt mit Sign Bit, deswegen gibt es einen Unterschied
zwischen +0 und -0, auch wenn er nur ein Bit ist.
Was ich nicht weiß, ist, was passiert, wenn einer der Operanden
unendlich ist. Mal sehen, was nach der Analysis geschehen müsste:
(+-)infinity/+finite = (+-)infinity
(+-)infinity/-finite = (-+)infinity
+finite/(+-)infinity = (+-)0
-finite/(+-)infinity = (-+)0
Und wenn einer der Operanden NaN ist, ist das Ergebnis natürlich auch
NaN. Vorausgesetzt, die Invalid Exception ist gemaskt oder die NaNs sind
QNaNs.
Tschö,
Markus
--
GUI - ein Hintergrundbild und zwölf XTerms
vim -c "exec \"norm iwHFG#NABGURE#IVZ#UNPXRE\"|%s/#/ /g|norm g??g~~"
.
- Follow-Ups:
- Re: Division durch Null
- From: Stefan Reuther
- Re: Division durch Null
- References:
- Division durch Null
- From: Markus Wichmann
- Re: Division durch Null
- From: Thomas Koller
- Re: Division durch Null
- From: Markus Wichmann
- Re: Division durch Null
- From: Rainer Weikusat
- Re: Division durch Null
- From: Thomas Richter
- Re: Division durch Null
- From: Roland Damm
- Division durch Null
- Prev by Date: Re: Division durch Null
- Next by Date: Re: Division durch Null
- Previous by thread: Re: Division durch Null
- Next by thread: Re: Division durch Null
- Index(es):
Relevant Pages
|