25#if (defined (__GNUC__) && !defined (__sun) && !defined (__hpux)) || \
30#if defined (__linux__) || defined (__MINGW32__) || defined (__CYGWIN__) || \
31 defined (__BORLANDC__) || defined (__DMC__) || defined (__HP_aCC)
33# if defined (__BORLANDC__)
41# if defined (_STLP_BIG_ENDIAN)
44# elif defined (_STLP_LITTLE_ENDIAN)
48# error Unknown endianess
53# if defined (__linux__)
56union ieee854_long_double {
61 unsigned int mantissa1:32;
62 unsigned int mantissa0:32;
63 unsigned int exponent:15;
64 unsigned int negative:1;
65 unsigned int empty:16;
69# define IEEE854_LONG_DOUBLE_BIAS 0x3fff
81#if !defined (_STLP_NO_WCHAR_T)
84 wchar_t& Plus,
wchar_t& Minus,
85 wchar_t& pow_e,
wchar_t& pow_E,
87 char ndigits[11] =
"0123456789";
89 Minus = ct.widen(
'-');
90 pow_e = ct.widen(
'e');
91 pow_E = ct.widen(
'E');
102#if defined (_STLP_MSVC) || defined (__BORLANDC__) || defined (__ICL)
103typedef unsigned long uint32;
105# define ULL(x) x##Ui64
106#elif defined (__unix) || defined (__MINGW32__) || \
107 (defined (__DMC__) && (__LONGLONG)) || defined (__WATCOMC__)
110# define ULL(x) x##ULL
112# error There should be some unsigned 64-bit integer on the system!
121 const uint64 u0 =
u & low_mask;
134 low += (
x & low_mask) << 32;
135 high =
u1 *
v1 +
w2 + (
x >> 32);
140# define bit11 ULL(0x7ff)
141# define exponent_mask (bit11 << 52)
143# if !defined (__GNUC__) || (__GNUC__ != 3) || (__GNUC_MINOR__ != 4) || \
144 (!defined (__CYGWIN__) && !defined (__MINGW32__))
160ULL(0xa000000000000000),
161ULL(0xc800000000000000),
162ULL(0xfa00000000000000),
163ULL(0x9c40000000000000),
164ULL(0xc350000000000000),
165ULL(0xf424000000000000),
166ULL(0x9896800000000000),
167ULL(0xbebc200000000000),
168ULL(0xee6b280000000000),
169ULL(0x9502f90000000000),
170ULL(0xba43b74000000000),
171ULL(0xe8d4a51000000000),
172ULL(0x9184e72a00000000),
173ULL(0xb5e620f480000000),
174ULL(0xe35fa931a0000000),
175ULL(0x8e1bc9bf04000000),
176ULL(0xb1a2bc2ec5000000),
177ULL(0xde0b6b3a76400000),
178ULL(0x8ac7230489e80000),
179ULL(0xad78ebc5ac620000),
180ULL(0xd8d726b7177a8000),
181ULL(0x878678326eac9000),
182ULL(0xa968163f0a57b400),
183ULL(0xd3c21bcecceda100),
184ULL(0x84595161401484a0),
185ULL(0xa56fa5b99019a5c8),
186ULL(0xcecb8f27f4200f3a),
188ULL(0xd0cf4b50cfe20766),
189ULL(0xd2d80db02aabd62c),
190ULL(0xd4e5e2cdc1d1ea96),
191ULL(0xd6f8d7509292d603),
192ULL(0xd910f7ff28069da4),
193ULL(0xdb2e51bfe9d0696a),
194ULL(0xdd50f1996b947519),
195ULL(0xdf78e4b2bd342cf7),
196ULL(0xe1a63853bbd26451),
197ULL(0xe3d8f9e563a198e5),
202ULL(0xfd87b5f28300ca0e),
203ULL(0xfb158592be068d2f),
204ULL(0xf8a95fcf88747d94),
205ULL(0xf64335bcf065d37d),
206ULL(0xf3e2f893dec3f126),
207ULL(0xf18899b1bc3f8ca2),
208ULL(0xef340a98172aace5),
209ULL(0xece53cec4a314ebe),
210ULL(0xea9c227723ee8bcb),
211ULL(0xe858ad248f5c22ca),
212ULL(0xe61acf033d1a45df),
213ULL(0xe3e27a444d8d98b8),
214ULL(0xe1afa13afbd14d6e)
2184,7,10,14,17,20,24,27,30,34,37,40,44,47,50,54,57,60,64,67,70,74,77,80,84,87,90,
219183,276,369,462,555,648,741,834,927,1020,
220-93,-186,-279,-372,-465,-558,-651,-744,-837,-930,-1023,-1116,-1209
229#define _Stl_HIBITULL (ULL(1) << 63)
238 ((prodlo >> 62) == 0x3)) {
245 p = (prodhi << 1) | (prodlo >> 63);
254 if (((
p & 0x1) != 0) ||
275 int exp_hi = 0, exp_lo =
exp;
276 int tlo =
TEN_1, thi;
282 while (exp_lo > 27) {
303 hi = (
min) (exp_hi, num_hi);
312 lo = tlo + exp_lo -1;
326#if !defined (__linux__)
353 bufferend =
buffer + ndigit;
356 while (
buffer < bufferend) {
371 if ((
value >> 32) != 0) { nzero = 32; }
372 if ((
value >> (16 + nzero)) != 0) { nzero += 16; }
373 if ((
value >> ( 8 + nzero)) != 0) { nzero += 8; }
374 if ((
value >> ( 4 + nzero)) != 0) { nzero += 4; }
375 if ((
value >> ( 2 + nzero)) != 0) { nzero += 2; }
376 if ((
value >> ( 1 + nzero)) != 0) { nzero += 1; }
377 if ((
value >> ( nzero)) != 0) { nzero += 1; }
380 value <<= (64 - nzero);
397 int lead0 = 12 - bexp;
405 else if (lead0 == 64) {
411 rest =
value & (((
ULL(1) << lead0)-1)-1);
417 if (guard && ((
value & 1) || rest) ) {
419 if (
value == (
ULL(1) << (limits::digits - 1))) {
428 rest =
value & ((1 << 10) - 1);
441 if (((
value&1)!=0) || (rest!=0)) {
443 if ((
value >> 53) != 0) {
463 if (bexp > limits::max_exponent) {
464 return limits::infinity();
467 value &= ~(
ULL(1) << (limits::digits - 1));
478#if defined (__linux__) || defined (__MINGW32__) || defined (__CYGWIN__) || \
479 defined (__BORLANDC__) || defined (__DMC__) || defined (__HP_aCC)
481template <
class D,
class IEEE,
int M,
int BIAS>
487 char *bufferend =
buffer + ndigit;
491 while (
buffer < bufferend ) {
496 if ( vv.i64 ==
ULL(0) ) {
506 if ((vv.i64 >> 32) != 0) { nzero = 32; }
507 if ((vv.i64 >> (16 + nzero)) != 0) { nzero += 16; }
508 if ((vv.i64 >> ( 8 + nzero)) != 0) { nzero += 8; }
509 if ((vv.i64 >> ( 4 + nzero)) != 0) { nzero += 4; }
510 if ((vv.i64 >> ( 2 + nzero)) != 0) { nzero += 2; }
511 if ((vv.i64 >> ( 1 + nzero)) != 0) { nzero += 1; }
512 if ((vv.i64 >> ( nzero)) != 0) { nzero += 1; }
528 if ( bexp >= limits::min_exponent ) {
529 if ( limits::digits < 64 ) {
531 uint64_t rest = vv.i64 & ((~ULL(0) /
ULL(2)) >> (limits::digits - 1));
545 if ( ((vv.i64 & 1) != 0) || (rest != 0) ) {
547 if ( (vv.i64 >> (limits::digits < 64 ? limits::digits : 0)) != 0 ) {
554 vv.i64 &= ~(
ULL(1) << (limits::digits - 1));
570 if (bexp > limits::max_exponent) {
571 return limits::infinity();
578 v.ieee.mantissa0 = vv.i32.hi;
579 v.ieee.mantissa1 = vv.i32.lo;
581 v.ieee.exponent = bexp +
BIAS - 1;
588 if (bexp < -limits::digits) {
597 int lead0 =
M - bexp;
607 }
else if (lead0 == 64) {
608 rest = vv.i64 & ((
ULL(1) << 63)-1);
609 guard = (
uint32) ((vv.i64 >> 63) & 1 );
612 rest = vv.i64 & (((
ULL(1) << lead0)-1)-1);
613 guard = (
uint32) (((vv.i64 >> lead0)-1) & 1);
618 if (guard && ( (vv.i64 & 1) || rest)) {
620 if (vv.i64 == (
ULL(1) << (limits::digits - 1))) {
623 v.ieee.mantissa0 = 0;
624 v.ieee.mantissa1 = 0;
634 v.ieee.mantissa0 = vv.i32.hi;
635 v.ieee.mantissa1 = vv.i32.lo;
646 const int max_digits = limits::digits10 + 2;
648 unsigned Negate, decimal_point;
660 }
else if (
c ==
'-') {
673 if (
d ==
digits + max_digits) {
675 exp += (decimal_point ^ 1);
682 exp -= decimal_point;
684 }
else if (
c == (
unsigned int) dpchar && !decimal_point) {
697 if (
c ==
'e' -
'0' ||
c ==
'E' -
'0') {
698 register unsigned negate_exp = 0;
701 if (
c ==
'+' ||
c ==
' ') {
703 }
else if (
c ==
'-') {
707 if (
c -=
'0',
c < 10) {
711 }
while (
c -=
'0',
c < 10);
722 if ((
exp +
n - 1) < limits::min_exponent10) {
725 else if ((
exp +
n - 1) > limits::max_exponent10) {
726 x = limits::infinity();
744#if defined (__linux__) || defined (__MINGW32__) || defined (__CYGWIN__) || \
745 defined (__BORLANDC__) || defined (__DMC__) || defined (__HP_aCC)
747template <
class D,
class IEEE,
int M,
int BIAS>
748D _Stl_string_to_doubleT(
const char *
s)
751 const int max_digits = limits::digits10; ;
753 unsigned decimal_point;
766 }
else if (
c ==
'-') {
779 if (
d ==
digits + max_digits) {
781 exp += (decimal_point ^ 1);
788 exp -= decimal_point;
790 }
else if (
c == (
unsigned int) dpchar && !decimal_point) {
802 if (
c ==
'e'-
'0' ||
c ==
'E'-
'0') {
803 bool negate_exp =
false;
806 if (
c ==
'+' ||
c ==
' ') {
808 }
else if (
c ==
'-') {
812 if (
c -=
'0',
c < 10) {
816 }
while (
c -=
'0',
c < 10);
826 if ((
exp +
n - 1) < limits::min_exponent10) {
828 }
else if ((
exp +
n - 1) > limits::max_exponent10 ) {
830 x = limits::infinity();
839 return Negate ? -
x :
x;
847#if !defined (__linux__)
850 val = (
float)_Stl_string_to_doubleT<double,ieee754_double,12,IEEE754_DOUBLE_BIAS>(
v.c_str());
857#if !defined (__linux__)
860 val = _Stl_string_to_doubleT<double,ieee754_double,12,IEEE754_DOUBLE_BIAS>(
v.c_str());
864#if !defined (_STLP_NO_LONG_DOUBLE)
867#if !defined (__linux__) && !defined (__MINGW32__) && !defined (__CYGWIN__) && \
868 !defined (__BORLANDC__) && !defined (__DMC__) && !defined (__HP_aCC)
873 val = _Stl_string_to_doubleT<long double,ieee854_long_double,16,IEEE854_LONG_DOUBLE_BIAS>(
v.c_str());
_Tp _STLP_CALL norm(const complex< _Tp > &__z)
static const WCHAR empty[]
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
__kernel_ptrdiff_t ptrdiff_t
#define _STLP_STATIC_ASSERT(expr)
#define _STLP_MOVE_TO_STD_NAMESPACE
#define _STLP_BEGIN_NAMESPACE
#define _STLP_END_NAMESPACE
#define _STLP_MOVE_TO_PRIV_NAMESPACE
GLint GLint GLint GLint GLint x
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble GLdouble w2
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble w1
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
static const int digits[]
static size_t double int ndigits
static float(__cdecl *square_half_float)(float x
void _Stl_set_exponent(uint64 &val, uint64 exp)
static const short _Stl_twoexp[80]
static const uint64 _Stl_tenpow[80]
static void _Stl_mult64(const uint64 u, const uint64 v, uint64 &high, uint64 &low)
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE void _STLP_CALL _Initialize_get_float(const ctype< wchar_t > &ct, wchar_t &Plus, wchar_t &Minus, wchar_t &pow_e, wchar_t &pow_E, wchar_t *digits)
void _STLP_CALL __string_to_float(const __iostring &v, float &val)
static double _Stl_string_to_double(const char *s)
static void _Stl_norm_and_round(uint64 &p, int &norm, uint64 prodhi, uint64 prodlo)
static double _Stl_atod(char *buffer, ptrdiff_t ndigit, int dexp)
static void _Stl_tenscale(uint64 &p, int exp, int &bexp)