Mercurial > ecos
comparison packages/language/c/libc/current/tests/signal/signal2.c @ 38:e7ba79f6d3a8 ecos-sw-1999-09-23
Merge from eCos master repository on 1999-09-23-20:10:25-BST
| author | jlarmour |
|---|---|
| date | Thu, 23 Sep 1999 19:52:27 +0000 |
| parents | e97d78785e2d |
| children | c38311975d4f |
comparison
equal
deleted
inserted
replaced
| 37:0b25345c9c69 | 38:e7ba79f6d3a8 |
|---|---|
| 106 } while(p != 0); | 106 } while(p != 0); |
| 107 } // cause_memerror() | 107 } // cause_memerror() |
| 108 | 108 |
| 109 // num must always be 0 - do it this way in case the optimizer tries to | 109 // num must always be 0 - do it this way in case the optimizer tries to |
| 110 // get smart | 110 // get smart |
| 111 static double | 111 static int |
| 112 cause_fpe(int num) | 112 cause_fpe(int num) |
| 113 { | 113 { |
| 114 return 1.0/num; | 114 double a; |
| 115 | |
| 116 a = 1.0/num; // Depending on FPU emulation and/or | |
| 117 // the FPU architecture, this may | |
| 118 // cause an exception. | |
| 119 // (float division by zero) | |
| 120 | |
| 121 return ((int)a)/num; // This may cause an exception if | |
| 122 // the architecture supports it. | |
| 123 // (integer division by zero). | |
| 115 } // cause_fpe() | 124 } // cause_fpe() |
| 116 | 125 |
| 117 #endif | 126 #endif |
| 118 | 127 |
| 119 int | 128 int |
