[SERVER-8944] Use C++11 standard library functions for double NaN and Infinity detection Created: 11/Mar/13 Updated: 25/Jan/17 Resolved: 05/Feb/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 3.1.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andy Schwerin | Assignee: | Siyuan Zhou |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Sprint: | RPL 0 3/13/15 |
| Participants: |
| Description |
|
We have home-grown platform-independent implementations now, which are not maximally efficient and may not be truly portable. |
| Comments |
| Comment by Githook User [ 05/Feb/15 ] |
|
Author: {u'username': u'visualzhou', u'name': u'Siyuan Zhou', u'email': u'siyuan.zhou@mongodb.com'}Message: |
| Comment by Andy Schwerin [ 15/Jan/14 ] |
|
In a C++11 system, we could use std::isnan(). On other systems if we're doing IEEE-compliant floating point, barring compiler errors, we can compare values against themselves. That is, given a double f, f != f will only be true if f is not-a-number. However, if the compiler isn't doing IEEE-compliant floating point, it may elide the check, assuming it to be false. Using the fastmath argument to gcc can cause this problem. |