Changeset 3177


Ignore:
Timestamp:
Mar 15, 2014, 2:50:51 PM (8 years ago)
Author:
Peter
Message:

Change behaviour if convert<T> and is<T> so they accept "-nan" (case insensitively) as an argument if T is a signed type. closes #783

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/utility.cc

    r3114 r3177  
    153153  utility::convert<double>("inf");
    154154  utility::convert<double>("NaN");
     155  utility::convert<double>("-NaN");
     156  utility::convert<double>(" -NaN");
    155157
    156158  suite.add(utility::convert(1.23)=="1.23");
  • trunk/yat/utility/utility.h

    r3066 r3177  
    495495    ss >> result;
    496496    if (ss.fail()) {
    497       if (is_nan(s)) {
     497      if (is_nan(s) || is_equal(s, "-nan")) {
    498498        result = std::numeric_limits<T>::quiet_NaN();
    499499        return true;
Note: See TracChangeset for help on using the changeset viewer.