- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hi,
I would like to detect high values in my program like 1e30. (real*4 or real*8)
With -fpe0 compiler option, the limit to detect overflows are 1e39 (real*4) and 1e69(real*8). Is it possible to configure this limit in order to decrease it ?
Best Regrds
Thierry
- Balises:
- Intel® Fortran Compiler
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
With -fpe0 you get an error when a value exceeds the range of the datatype, which is based on the processor detecting an exception. For single precision that is about 1E38 and for double precision, 1E308. You can't control the limit for overflow checking.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
You could set -fpe0, then insert into your code
real, parameter :: TooBig = huge(real) - YourUpperLimit
real, volatile :: waste ! ensure compiler does not optimize stores out of the code
...
waste = TestingNumber + TooBig ! will generate fpe on overflow
Expand on this for negative and real(8)
Jim Dempsey
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable