Блог пользователя JasonMendoza2008

Автор JasonMendoza2008, история, 6 часов назад, По-английски

Consider this code:

#include <stdio.h>
#include <float.h>

int main() {
    double a = 100.0;
    printf("a: %.6lf\n", a);
    return 0;
}

It should print 100.000000 right? It does on https://www.onlinegdb.com/online_c_compiler, it does on my local computer. But on codeforces: https://i.imgur.com/P2CCY7Q.png

I'm more of a Python user so maybe I'm missing something big and it's actually not a bug?

Теги gcc, bug
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
6 часов назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

i dont know why but seems lf in codeforces is for long double, and f is for double.

»
6 часов назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

I can reproduce. Don't know the exact reason but gcc 5.1 is very old (April 22, 2015), don't use it unless you have a specific reason. For g++6.4 and above look expected.