- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It looks like the compiler warning: remark #2259: non-pointer conversion from "double" to "float" may lose significant bits, does not go away with the C++ static_cast<> constructs.
If you compile the following example with the -w2 option you will see that the compiler issues remark #2259 for the static_cast
int main() {
double x = 3.4;
//This line will create a warning (as it should)
float y1 = x;
//This line will not create a warning (because of the cast)
float y2 = (float)(x);
//This line will create a warning (the cast should prevent it)
float y3 = static_cast
cout << y1<< endl;
cout << y2 << endl;
cout << y3 << nedl;
return 0;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
this issue has been fixed in 12.1 and newer.
sorry for the delayed update.
Jennifer
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page