When the `%La` specifier is used in `printf()` to format
the C99 hexdecimal floating point value `0x5p-80l`,
a wrong result is generated, as shown in this example:

    E:\Desktop>cat test.c
    extern int __mingw_printf(const char *, ...);
    int main(){
            __mingw_printf("%La\n", 0x5p-80l);
    }
    
    E:\Desktop>gcc test.c -std=c99
    
    E:\Desktop>a.exe
    0x0p-141

Removing the `__mingw_` prefix and testing the same program
on Linux gives the correct result:

    lh_mouse@lhmouse-dev:~$ uname -a
    Linux lhmouse-dev 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 
(2016-07-02) x86_64 GNU/Linux
    lh_mouse@lhmouse-dev:~$ gcc test.c -std=c99
    lh_mouse@lhmouse-dev:~$ ./a.out 
    0xap-81

Is this a bug in `printf()`?
                                
--------------
Best regards,
lh_mouse
2016-09-09


------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to