- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was wondering which header file includes a well defined constatnt for the numberical value + or- INFINITY for single or double precission FP quantities.
Some code is checking for preprocessor contstat "INFINITY" and if unddefined it "sets" it as follows :
#ifdef INFINITY
const double inf = INFINITY;
#else
const double inf = 1.0 / 0.0;
#endif
However, when I compile with icc I get:
harminv-main.c(126): error: floating-point operation result is out of range
const double inf = 1.0 / 0.0;
^
Where are these numerical quantities defined or how can I go about properly producing them programmatically with Intel compilers?
thanks ....
Michael
Some code is checking for preprocessor contstat "INFINITY" and if unddefined it "sets" it as follows :
#ifdef INFINITY
const double inf = INFINITY;
#else
const double inf = 1.0 / 0.0;
#endif
However, when I compile with icc I get:
harminv-main.c(126): error: floating-point operation result is out of range
const double inf = 1.0 / 0.0;
^
Where are these numerical quantities defined or how can I go about properly producing them programmatically with Intel compilers?
thanks ....
Michael
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For Intel Windows C, INFINITY is defined in (which excludes use of Microsoft . Presumably, it would be defined in linux under -std=c99. As the discussions you have quoted indicate, INFINITY typically is a macro expression which isn't accepted as a compile-time constant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting TimP (Intel)
For Intel Windows C, INFINITY is defined in (which excludes use of Microsoft . Presumably, it would be defined in linux under -std=c99. As the discussions you have quoted indicate, INFINITY typically is a macro expression which isn't accepted as a compile-time constant.
Thanks Tim,
I couldn't see the '-std=c99' option in man page of icc. I tried and worked though.
thanks for the reply
Michael
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page