Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 920168 Details for
Bug 1108800
std::numeric_limits<double>::max() returns 1.79769e+308
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
handle double as double an not float
cxxtools-2.2-serialization-double.patch (text/plain), 4.07 KB, created by
Menanteau Guy
on 2014-07-23 08:44:37 UTC
(
hide
)
Description:
handle double as double an not float
Filename:
MIME Type:
Creator:
Menanteau Guy
Created:
2014-07-23 08:44:37 UTC
Size:
4.07 KB
patch
obsolete
>--- include/cxxtools/serializationinfo.h.ori 2014-07-21 09:57:08.370004721 -0400 >+++ include/cxxtools/serializationinfo.h 2014-07-22 11:59:45.710004724 -0400 >@@ -144,7 +144,7 @@ class CXXTOOLS_API SerializationInfo > #endif > > void setValue(float value) { _setFloat(value); } >- void setValue(double value) { _setFloat(value); } >+ void setValue(double value) { _setDouble(value); } > void setValue(long double value) { _setFloat(value); } > void setNull(); > >@@ -183,7 +183,7 @@ class CXXTOOLS_API SerializationInfo > void getValue(float& value) const > { value = static_cast<float>(_getFloat("float", std::numeric_limits<float>::max())); } > void getValue(double& value) const >- { value = static_cast<double>(_getFloat("double", std::numeric_limits<double>::max())); } >+ { value = static_cast<double>(_getDouble("double", std::numeric_limits<double>::max())); } > void getValue(long double& value) const > { value = static_cast<long double>(_getFloat("long double", std::numeric_limits<long double>::max())); } > >@@ -291,6 +291,7 @@ class CXXTOOLS_API SerializationInfo > void _setInt(int_type value); > void _setUInt(unsigned_type value); > void _setFloat(long double value); >+ void _setDouble(double value); > > bool _getBool() const; > wchar_t _getWChar() const; >@@ -298,6 +299,7 @@ class CXXTOOLS_API SerializationInfo > int_type _getInt(const char* type, int_type min, int_type max) const; > unsigned_type _getUInt(const char* type, unsigned_type max) const; > long double _getFloat(const char* type, long double max) const; >+ double _getDouble(const char* type, double max) const; > > union U > { >--- src/serializationinfo.cpp.ori 2014-07-22 10:54:22.700004723 -0400 >+++ src/serializationinfo.cpp 2014-07-22 12:57:20.400004721 -0400 >@@ -496,6 +496,19 @@ void SerializationInfo::_setFloat(long d > _category = Value; > } > >+void SerializationInfo::_setDouble(double value) >+{ >+ if (_t != t_float) >+ { >+ _releaseValue(); >+ _t = t_float; >+ } >+ >+ _u._f = value; >+ >+ _category = Value; >+} >+ > > void SerializationInfo::getValue(String& value) const > { >@@ -732,6 +745,54 @@ long double SerializationInfo::_getFloat > && ret == ret // check for NaN > && (ret < -max || ret > max)) > { >+ std::ostringstream msg; >+ msg << "value " << ret << " does not fit into " << type; >+ throw std::range_error(msg.str()); >+ } >+ >+ return ret; >+} >+ >+double SerializationInfo::_getDouble(const char* type, double max) const >+{ >+ double ret = 0; >+ >+ switch (_t) >+ { >+ case t_none: break; >+ >+ case t_string: try >+ { >+ ret = convert<double>(_String()); >+ } >+ catch (const ConversionError&) >+ { >+ ConversionError::doThrow(type, "String", _String().narrow().c_str()); >+ } >+ break; >+ >+ case t_string8: try >+ { >+ ret = convert<double>(_String8()); >+ } >+ catch (const ConversionError&) >+ { >+ ConversionError::doThrow(type, "string", _String8().c_str()); >+ } >+ break; >+ >+ case t_char: ret = _u._c - '0'; break; >+ case t_bool: ret = _u._b; break; >+ case t_int: ret = _u._i; break; >+ case t_uint: ret = _u._u; break; >+ case t_float: ret = _u._f; break; >+ } >+ >+ if (ret != std::numeric_limits<double>::infinity() >+ && ret != -std::numeric_limits<double>::infinity() >+ && ret == ret // check for NaN >+ && (ret < -max || ret > max)) >+ { > std::ostringstream msg; > msg << "value " << ret << " does not fit into " << type; > throw std::range_error(msg.str());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1108800
: 920168 |
921759