Index: include/locale
===================================================================
--- include/locale	(revision 193991)
+++ include/locale	(working copy)
@@ -813,6 +813,10 @@
                              ios_base::iostate& __err, long double& __v) const;
     virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
                              ios_base::iostate& __err, void*& __v) const;
+
+    template <class _Fp>
+    iter_type do_get_floating_point(iter_type __b, iter_type __e, ios_base& __iob,
+                             ios_base::iostate& __err, _Fp& __v) const;
 };
 
 template <class _CharT, class _InputIterator>
@@ -1234,12 +1238,15 @@
     return __b;
 }
 
+// floating point
+
 template <class _CharT, class _InputIterator>
+template <class _Fp>
 _InputIterator
-num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
+num_get<_CharT, _InputIterator>::do_get_floating_point(iter_type __b, iter_type __e,
                                         ios_base& __iob,
                                         ios_base::iostate& __err,
-                                        float& __v) const
+                                        _Fp& __v) const
 {
     // Stage 1, nothing to do
     // Stage 2
@@ -1277,7 +1284,7 @@
     if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
         *__g_end++ = __dc;
     // Stage 3
-    __v = __num_get_float<float>(__a, __a_end, __err);
+    __v = __num_get_float<_Fp>(__a, __a_end, __err);
     // Digit grouping checked
     __check_grouping(__grouping, __g, __g_end, __err);
     // EOF checked
@@ -1291,51 +1298,19 @@
 num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
                                         ios_base& __iob,
                                         ios_base::iostate& __err,
+                                        float& __v) const
+{
+    return this->do_get_floating_point(__b, __e, __iob, __err, __v );
+}
+
+template <class _CharT, class _InputIterator>
+_InputIterator
+num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
+                                        ios_base& __iob,
+                                        ios_base::iostate& __err,
                                         double& __v) const
 {
-    // Stage 1, nothing to do
-    // Stage 2
-    char_type __atoms[32];
-    char_type __decimal_point;
-    char_type __thousands_sep;
-    string __grouping = this->__stage2_float_prep(__iob, __atoms,
-                                                  __decimal_point,
-                                                  __thousands_sep);
-    string __buf;
-    __buf.resize(__buf.capacity());
-    char* __a = &__buf[0];
-    char* __a_end = __a;
-    unsigned __g[__num_get_base::__num_get_buf_sz];
-    unsigned* __g_end = __g;
-    unsigned __dc = 0;
-    bool __in_units = true;
-    char __exp = 'E';
-    for (; __b != __e; ++__b)
-    {
-        if (__a_end - __a == __buf.size())
-        {
-            size_t __tmp = __buf.size();
-            __buf.resize(2*__buf.size());
-            __buf.resize(__buf.capacity());
-            __a = &__buf[0];
-            __a_end = __a + __tmp;
-        }
-        if (this->__stage2_float_loop(*__b, __in_units, __exp, __a, __a_end,
-                                      __decimal_point, __thousands_sep,
-                                      __grouping, __g, __g_end,
-                                      __dc, __atoms))
-            break;
-    }
-    if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
-        *__g_end++ = __dc;
-    // Stage 3
-    __v = __num_get_float<double>(__a, __a_end, __err);
-    // Digit grouping checked
-    __check_grouping(__grouping, __g, __g_end, __err);
-    // EOF checked
-    if (__b == __e)
-        __err |= ios_base::eofbit;
-    return __b;
+    return this->do_get_floating_point(__b, __e, __iob, __err, __v );
 }
 
 template <class _CharT, class _InputIterator>
@@ -1345,49 +1320,7 @@
                                         ios_base::iostate& __err,
                                         long double& __v) const
 {
-    // Stage 1, nothing to do
-    // Stage 2
-    char_type __atoms[32];
-    char_type __decimal_point;
-    char_type __thousands_sep;
-    string __grouping = this->__stage2_float_prep(__iob, __atoms,
-                                                  __decimal_point,
-                                                  __thousands_sep);
-    string __buf;
-    __buf.resize(__buf.capacity());
-    char* __a = &__buf[0];
-    char* __a_end = __a;
-    unsigned __g[__num_get_base::__num_get_buf_sz];
-    unsigned* __g_end = __g;
-    unsigned __dc = 0;
-    bool __in_units = true;
-    char __exp = 'E';
-    for (; __b != __e; ++__b)
-    {
-        if (__a_end - __a == __buf.size())
-        {
-            size_t __tmp = __buf.size();
-            __buf.resize(2*__buf.size());
-            __buf.resize(__buf.capacity());
-            __a = &__buf[0];
-            __a_end = __a + __tmp;
-        }
-        if (this->__stage2_float_loop(*__b, __in_units, __exp, __a, __a_end,
-                                      __decimal_point, __thousands_sep,
-                                      __grouping, __g, __g_end,
-                                      __dc, __atoms))
-            break;
-    }
-    if (__grouping.size() != 0 && __in_units && __g_end-__g < __num_get_base::__num_get_buf_sz)
-        *__g_end++ = __dc;
-    // Stage 3
-    __v = __num_get_float<long double>(__a, __a_end, __err);
-    // Digit grouping checked
-    __check_grouping(__grouping, __g, __g_end, __err);
-    // EOF checked
-    if (__b == __e)
-        __err |= ios_base::eofbit;
-    return __b;
+    return this->do_get_floating_point(__b, __e, __iob, __err, __v );
 }
 
 template <class _CharT, class _InputIterator>
