如何获得DOUBLE_MAX? [英] How do I get DOUBLE_MAX?

查看:1526
本文介绍了如何获得DOUBLE_MAX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AFAIK,C只支持几种数据类型:

AFAIK, C supports just a few data types:

int, float, double, char, void enum.

我需要存储一个可以达到10位数字的数字。因为我从

I need to store a number that could reach into the high 10 digits. Since I'm getting a low 10 digit # from


INT_MAX

INT_MAX

,我想我需要一个double。

, I suppose I need a double.

< limits.h> 没有DOUBLE_MAX。我在互联网上发现一个 DBL_MAX ,表示这是LEGACY,似乎也是C ++。是我需要的两倍?为什么没有DOUBLE_MAX?

<limits.h> doesn't have a DOUBLE_MAX. I found a DBL_MAX on the internet that said this is LEGACY and also appears to be C++. Is double what I need? Why is there no DOUBLE_MAX?

推荐答案

DBL_MAX href =http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/float.h.html =noreferrer> < float.h> 。其在 < limits.h> 在unix上被标记为(LEGACY)。

DBL_MAX is defined in <float.h>. Its availability in <limits.h> on unix is what is marked as "(LEGACY)".

(链接到unix标准,即使你没有unix标签因为那可能是你找到了LEGACY的符号,但是float.h中显示的大部分也在C标准中回到C89)

(linking to the unix standard even though you have no unix tag since that's probably where you found the "LEGACY" notation, but much of what is shown there for float.h is also in the C standard back to C89)

这篇关于如何获得DOUBLE_MAX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆