[Bug exp/9301] Wrong arithmetic conversion

simon.marchi at ericsson dot com sourceware-bugzilla@sourceware.org
Tue Aug 21 15:10:00 GMT 2018


https://sourceware.org/bugzilla/show_bug.cgi?id=9301

Simon Marchi <simon.marchi at ericsson dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |simon.marchi at ericsson dot com
         Resolution|---                         |FIXED

--- Comment #1 from Simon Marchi <simon.marchi at ericsson dot com> ---
With today's gdb, I get:

(gdb) p (float)123456792.0 > 123456789
$11 = 0
(gdb) p (float)123456792.0 > (float)123456789
$12 = 0
(gdb) p 123456789123456784.0 == 123456789123456789LL
$13 = 1
(gdb) p 123456789123456784.0 == (double)123456789123456789LL
$14 = 1


And this C program:

---
#include <stdio.h>

int main()
{
        printf ("%d\n", (float)123456792.0 > 123456789);
        printf ("%d\n", (float)123456792.0 > (float)123456789);
        printf ("%d\n", 123456789123456784.0 == 123456789123456789LL);
        printf ("%d\n", 123456789123456784.0 == (double)123456789123456789LL);
}
---

outputs:

0
0
1
1

So I assume it's working fine now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list