[llvm-dev] Incorrect return values for APFloat::convertFromString?

Mueller-Roemer, Johannes Sebastian via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 2 07:47:43 PST 2016


I noticed some odd behavior with APFloat's convertFromString method.


1.       If I pass the hex representation of the closest value to 0.1 (0x19999Ap-24), everything is fine and opOk is returned. However, if I pass the same value as a decimal string (0.10000002384185791015625), opInexact is set.

2.       On the lower end of the scale, the smallest denormal 0x1p-149 returns opOk, but the slightly larger value 0x1.8p-149 has opUnderflow set and (as expected) opInexact.

Is this behavior correct?

--
Johannes S. Mueller-Roemer, MSc
Wiss. Mitarbeiter - Interactive Engineering Technologies (IET)

Fraunhofer-Institut für Graphische Datenverarbeitung IGD
Fraunhoferstr. 5  |  64283 Darmstadt  |  Germany
Tel +49 6151 155-606  |  Fax +49 6151 155-139
johannes.mueller-roemer at igd.fraunhofer.de  |  www.igd.fraunhofer.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160302/31a6c624/attachment.html>


More information about the llvm-dev mailing list