-----Original Message----- 
From: sisyph...@optusnet.com.au
Sent: Saturday, March 07, 2015 12:20 PM
To: mingw-w64-public@lists.sourceforge.net
Subject: [Mingw-w64-public] Problem casting long double to __float128

> Hi,
>
> With the 64-bit gcc-4.9.2 compiler available from:
> http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.9.2/threads-posix/sjlj/
>
> I have the issue that casting a long double inf to a __float128 results in 
> a __float128 nan.
> No such problem in casting a double inf - or with gcc-4.8.2 or 4.7.3.

Sorry - I *thought* it was a bug (which it is), but I wasn't sure about 
casting of floats (though I should have been).

Anyway, I found the conclusive info in appendix A of Kernighan & Ritchie 
(2nd edition):

[quote]
A6.4 Floating Types

When a less precise floating point value is converted to an equally or more 
precise floating type, the value is unchanged.
[end quote]

Cheers,
Rob 


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to