What is the difference between double and long double division?

  Kiến thức lập trình

Code:

#include <stdio.h>

int main()
{
    printf("%gn%Lgn", 1.0/2, 1.0L/2);
}

This code compiles using clang on Windows x64. I don’t have GCC at hand.
Result:

0.5
3.00965e-312

Why is this happening? (Another 10 characters)

New contributor

Eduard E. Tikhenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT