Commit 58c9703f by Paolo Carlini Committed by Paolo Carlini

locale_facets.tcc (num_get::_M_extract_float): Revert the last commit, is incorrect, sorry.

2003-10-29  Paolo Carlini  <pcarlini@suse.de>

        * include/bits/locale_facets.tcc (num_get::_M_extract_float):
	Revert the last commit, is incorrect, sorry.

From-SVN: r73042
parent f0dc1efa
2003-10-29 Paolo Carlini <pcarlini@suse.de> 2003-10-29 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (num_get::_M_extract_float):
Revert the last commit, is not correct, sorry.
2003-10-29 Paolo Carlini <pcarlini@suse.de>
* config/locale/generic/c_locale.cc: Add back <cmath> and * config/locale/generic/c_locale.cc: Add back <cmath> and
<cstdlib>. <cstdlib>.
......
...@@ -169,7 +169,7 @@ namespace std ...@@ -169,7 +169,7 @@ namespace std
string __found_grouping; string __found_grouping;
int __sep_pos = 0; int __sep_pos = 0;
bool __e; bool __e;
for (; __beg != __end; ++__beg) while (__beg != __end)
{ {
// Only look in digits. // Only look in digits.
const char_type __c = *__beg; const char_type __c = *__beg;
...@@ -182,6 +182,7 @@ namespace std ...@@ -182,6 +182,7 @@ namespace std
__xtrc += _S_atoms_in[__p - __lit]; __xtrc += _S_atoms_in[__p - __lit];
__found_mantissa = true; __found_mantissa = true;
++__sep_pos; ++__sep_pos;
++__beg;
} }
else if (__traits_type::eq(__c, __lc->_M_thousands_sep) else if (__traits_type::eq(__c, __lc->_M_thousands_sep)
&& __lc->_M_use_grouping && !__found_dec) && __lc->_M_use_grouping && !__found_dec)
...@@ -192,6 +193,7 @@ namespace std ...@@ -192,6 +193,7 @@ namespace std
{ {
__found_grouping += static_cast<char>(__sep_pos); __found_grouping += static_cast<char>(__sep_pos);
__sep_pos = 0; __sep_pos = 0;
++__beg;
} }
else else
{ {
...@@ -209,6 +211,7 @@ namespace std ...@@ -209,6 +211,7 @@ namespace std
__found_grouping += static_cast<char>(__sep_pos); __found_grouping += static_cast<char>(__sep_pos);
__xtrc += '.'; __xtrc += '.';
__found_dec = true; __found_dec = true;
++__beg;
} }
else if ((__e = __traits_type::eq(__c, __lit[_S_ie]) else if ((__e = __traits_type::eq(__c, __lit[_S_ie])
|| __traits_type::eq(__c, __lit[_S_iE])) || __traits_type::eq(__c, __lit[_S_iE]))
...@@ -216,18 +219,19 @@ namespace std ...@@ -216,18 +219,19 @@ namespace std
{ {
// Scientific notation. // Scientific notation.
__xtrc += __e ? _S_atoms_in[_S_ie] : _S_atoms_in[_S_iE]; __xtrc += __e ? _S_atoms_in[_S_ie] : _S_atoms_in[_S_iE];
__found_sci = true;
// Remove optional plus or minus sign, if they exist. // Remove optional plus or minus sign, if they exist.
if (++__beg != __end) if (++__beg != __end)
{ {
const bool __plus = __traits_type::eq(*__beg, __lit[_S_iplus]); const bool __plus = __traits_type::eq(*__beg, __lit[_S_iplus]);
if (__plus || __traits_type::eq(*__beg, __lit[_S_iminus])) if (__plus || __traits_type::eq(*__beg, __lit[_S_iminus]))
__xtrc += __plus ? _S_atoms_in[_S_iplus] {
: _S_atoms_in[_S_iminus]; __xtrc += __plus ? _S_atoms_in[_S_iplus]
__found_sci = true; : _S_atoms_in[_S_iminus];
++__beg;
}
} }
else
break;
} }
else else
// Not a valid input item. // Not a valid input item.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment