长双精度类型的数据输入输出格式该怎么表示?

yang2pipi 2003-12-09 05:30:40
c语言中长双精度用long double来定义,不知输入输出该怎么表示?谢谢!
...全文
1302 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
yang2pipi 2003-12-10
  • 打赏
  • 举报
回复
%f %e %g都不行呀。
yang2pipi 2003-12-10
  • 打赏
  • 举报
回复
谢谢!是%Lf %Le %Lg
LinuxPanther 2003-12-10
  • 打赏
  • 举报
回复
看到有星星的人在,只有学习的份了。
fierygnu 2003-12-10
  • 打赏
  • 举报
回复
是%Lf %Le %Lg
fierygnu 2003-12-09
  • 打赏
  • 举报
回复
L
Specifies that a following a , A , e , E , f , F , g , or G conversion specifier applies to a long double argument.
fireseed 2003-12-09
  • 打赏
  • 举报
回复
下面这些都是用于输出double的,你自己看看吧

%e:
double Signed value having the form [ – ]d.dddd e [sign]ddd where d is a single decimal digit, dddd is one or more decimal digits, ddd is exactly three decimal digits, and sign is + or –.

%E
double Identical to the e format except that E rather than e introduces the exponent.

%f
double Signed value having the form [ – ]dddd.dddd, where dddd is one or more decimal digits. The number of digits before the decimal point depends on the magnitude of the number, and the number of digits after the decimal point depends on the requested precision.


&g double Signed value printed in f or e format, whichever is more compact for the given value and precision. The e format is used only when the exponent of the value is less than –4 or greater than or equal to the precision argument. Trailing zeros are truncated, and the decimal point appears only if one or more digits follow it.


%G
double Identical to the g format, except that E, rather than e, introduces the exponent (where appropriate).
abitz 2003-12-09
  • 打赏
  • 举报
回复
%f

65,179

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧