ARM VERSION 1.2 Scheda Tecnica Pagina 220

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 276
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 219
Floating-point Support
5-22 Copyright © 1999-2001 ARM Limited. All rights reserved. ARM DUI 0067D
/* For all other invalid operations, raise SIGFPE as usual */
raise(SIGFPE);
}
Install the handler function as follows:
fenv_t env;
fegetenv(&env);
env.statusword |= FE_IEEE_MASK_INVALID;
env.invalid_handler = myhandler;
fesetenv(&env);
After the handler is installed, dividing 0.0 by 0.0 returns 1.0.
Exception trap handling by signals
If an exception is trapped but the trap handler address is set to
NULL
, a default trap
handler is used.
The default trap handler raises a
SIGFPE
signal. The default handler for
SIGFPE
prints an
error message and terminates the program.
If you trap
SIGFPE
, you can declare your signal handler function to have a second
parameter that tells you the type of floating-point exception that occurred. This feature
is provided for compatibility with Microsoft products. The values are
_FPE_INVALID
,
_FPE_ZERODIVIDE
,
_FPE_OVERFLOW
,
_FPE_UNDERFLOW
and
_FPE_INEXACT
. They are defined in
float.h
. For example:
void sigfpe(int sig, int etype) {
printf("SIGFPE (%s)\n",
etype == _FPE_INVALID ? "Invalid Operation" :
etype == _FPE_ZERODIVIDE ? "Divide by Zero" :
etype == _FPE_OVERFLOW ? "Overflow" :
etype == _FPE_UNDERFLOW ? "Underflow" :
etype == _FPE_INEXACT ? "Inexact Result" :
"Unknown");
}
signal(SIGFPE, (void(*)(int))sigfpe);
To generate your own
SIGFPE
signals with this extra information, you can call the
function
__rt_raise
instead of the ANSI function raise. In Example 5-1 on page 5-21,
instead of:
raise(SIGFPE);
it is better to code:
__rt_raise(SIGFPE, _FPE_INVALID);
Vedere la pagina 219
1 2 ... 215 216 217 218 219 220 221 222 223 224 225 ... 275 276

Commenti su questo manuale

Nessun commento

Panasonic TC15LV1 manuels

Manuels d'utilisation et guides de l'utilisateur pour Lecteurs de CD Panasonic TC15LV1.
Nous fournissons des manuels en pdf 2 Panasonic TC15LV1 à télécharger gratuitement par type de document : Manuel de l'utilisateur, Instructions d'exploitation






Plus de produits et de manuels pour Lecteurs de CD Panasonic

Modèles Type de document
SCPM29 Instructions d'exploitation     Panasonic SCPM29 Operating Instructions, 56 pages
RXD29 Instructions d'exploitation   Panasonic RXD27 Operating Instructions, 12 pages
SCPM54 Instructions d'exploitation   Panasonic SCPM54 Instrucțiuni de utilizare, 16 pages
SCRS32EG Instructions d'exploitation       Panasonic SCRS30EG Operating Instructions, 92 pages
SCPM25PP Instructions d'exploitation   Panasonic SCPM25PP Operating Instructions, 28 pages
SCRS54EG Instructions d'exploitation     Panasonic SCRS54EG Operating Instructions, 64 pages
SCNE5EG Instructions d'exploitation      Panasonic SCNE5EG Operating Instructions, 116 pages
TX15LV1F Instructions d'exploitation   Panasonic TX15LV1F Istruzioni per l'uso, 64 pages
SCPM4 Instructions d'exploitation   Panasonic SCPM4 Operating Instructions [pl] , 32 pages
SCPM33 Instructions d'exploitation   Panasonic SCPM33 Használati utasítások, 31 pages
TC11LV1 Instructions d'exploitation   Panasonic TC11LV1 Operating Instructions [et] [sv] , 60 pages
SCPM19 Instructions d'exploitation Panasonic SCPM19 사용 설명서, 28 pages
SCEN17 Instructions d'exploitation     Panasonic SCEN17 Operating Instructions, 24 pages
SCPMX70EG Instructions d'exploitation       Panasonic SCPMX70EG Operating Instructions, 104 pages
SCPM250BEG Instructions d'exploitation       Panasonic SCPM250BEG Operating Instructions, 100 pages
SCPM38 Instructions d'exploitation      Panasonic SCPM38 Operating Instructions, 60 pages
SCPM9 Instructions d'exploitation Panasonic SCPM9 操作说明, 24 pages
SCPM23 Instructions d'exploitation   Panasonic SCPM23 Operating Instructions, 16 pages
SCPM02 Instructions d'exploitation   Panasonic SCPM02 Инструкции за работа, 12 pages
SCPM45 Instructions d'exploitation   Panasonic SCPM45 Operating Instructions, 44 pages