Control: tags -1 upstream
Control: forwarded -1 https://bugs.kde.org/show_bug.cgi?id=421262
Control: retitle -1 valgrind causes miscalculation on long double

On 2018-02-12 03:04:30 +0100, Vincent Lefevre wrote:
> valgrind causes miscalculation on the following program:
> 
> ----------------------------------------
> #include <stdio.h>
> 
> int main (void)
> {
>   volatile union {
>     long double d;
>     unsigned long i[2];
>   } u;
> 
>   u.i[0] = 1;
>   u.i[1] = 0;
>   printf ("%La\n", u.d);
> 
>   return 0;
> }
> ----------------------------------------

Note that the above value is a subnormal.

This appears to be the same kind of problem as mentioned in a bug
reported upstream last month:

  https://bugs.kde.org/show_bug.cgi?id=421262

As said, the cause is that valgrind converts the value to
double precision.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to