about %Lf and %Le can not print rightly

zan Source

I ran a program like this:

#include <stdio.h>
int main(void)
float aboat = 32000.0;
double abet = 2.14e9;
long double dip =5.32e-5;

printf("%f can be written %e\n",aboat,aboat);
printf("And it's %a in hexadecimal, powers of 2 notation\n",aboat);
printf("%f can be written %e\n",abet, abet);
printf("%Lf can be written %Le\n",dip,dip);
                      \\ this statement can not print rightly 
return 0;

but it print like this :

32000.000000 can be written 3.200000e+004
And it's 0x1.f40000p+14 in hexadecimal, powers of 2 notation
2140000000.000000 can be written 2.140000e+009
00000 can be written 272.500183

as you can see , this result must be incorrect. but I can not find error, so is it a bug attribute to IDE ? I use JetBrains CLion 2017.3.4.

thanks for remind.this is my CMakeList.txt:

cmake_minimum_required(VERSION 3.9)
project(untitled1 C)


add_executable(untitled1 main.c)

And the gcc version is 6.3.0



comments powered by Disqus