2011/11/14 Simon de Graaf <[email protected]>:
> When running a Windows 32-bit or 64-bit cross-compiled executable
> under Windows (XP) 32-bit OS or 64-bit OS cout gives no good answers
> for "long double" datatype. (The problem does not exist under Linux).
> For example:
>
>     long double dx = 16.125e-08;
>     cout << "dx =" << dx << endl;
>
> You can fix the problem by casting it into "double":
>
>     cout << "dx =" << (double)dx << endl;
>
> At last i have fixed the problem by patching the compiler "ostream" files:
>
>    ./i686-w64-mingw32/include/c++/4.7.0/ostream
> and
>    ./x86_64-w64-mingw32/include/c++/4.7.0/ostream
>
> diff:
> 224c224,227
> <   { return _M_insert(__f); }
> ---
>  >   { //return _M_insert(__f);
>  >     //SdeG, cast "long double" into "double"
>  >     return _M_insert(static_cast<double>(__f));
>  >   }
>
> Your comments about this problem/fix are welcome.
>
> Regards,
> Simon de Graaf

The patch, which fix this without modifying compiler, was applied to
our trunk, v2, and v1 branch.  So in future there should no need to
touch libstdc++ for this in source.

Regards,
Kai

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to