[cfe-dev] APFloat::toString() handling of MS FLT_MAX and DBL_MAX

Will Wilson will at indefiant.com
Mon Apr 15 15:14:43 PDT 2013


It's not my code, but I have to support internally transforming it. In
addition some C code is also involved which precludes the use of templates.
Either way, I have to support it "as is". Unfortunately :)

- Will.


On 16 April 2013 00:04, Matthieu Brucher <matthieu.brucher at gmail.com> wrote:

> Hi,
>
> Nothing to do with clang, but why didn't the code use numeric_limits?
>
> Matthieu
>
>
> 2013/4/15 Will Wilson <will at indefiant.com>
>
>> Hi All,
>>
>> I'm rewriting MS C++ code via clang and have an issue involving the
>> printed representations of FLT_MAX and DBL_MAX. In both cases the printed
>> literals exceed the inputs.
>>
>> From MS float.h:
>>
>> #define DBL_MAX         1.7976931348623158e+308
>> // Becomes 1.797693134862316E+308
>>
>> #define FLT_MAX         3.402823466e+38F
>> // Becomes 3.4028235E+38F
>>
>> Rewriting the values leads to compilation errors due to the literals
>> exceeding their maximums. This doesn't altogether surprise me given the
>> nature of FP arithmetic and string conversion but I was wondering if this
>> could/should be treated as a bug given the significance of these values?
>>
>> - Will.
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>
>
> --
> Information System Engineer, Ph.D.
> Blog: http://matt.eifelle.com
> LinkedIn: http://www.linkedin.com/in/matthieubrucher
> Music band: http://liliejay.com/
>



-- 
*Indefiant Ltd.*
*
*
Firsby Lodge, New Main Road, Scamblesby, Louth, Lincs LN11 9XH UK
*Tel: +44 20 8123 7663 England Registered No. 07936820 VAT No. **128556202*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130416/4c51e814/attachment.html>


More information about the cfe-dev mailing list