#define是非常小的数字? [英] #define for very small numbers ?
问题描述
我需要将plancks定义为6.67 X 10 exp -34。是否可以使用#define进行
或者你建议使用
(静态?)const double。
在文章< 6f ********************************** @ w8g2000prd .g ooglegroups.com>,
pereges< Br ***** @ gmail.comwrote:
>我需要定义plancks常量6.67 X 10 exp -34。是否可以使用#define
#define Planck 6.67e-34
-
概念的美丽总是优于
表达的美。 - Walter J. Phillips
pereges写道:
我需要定义计划常数6.67 X 10 exp -34。是否可以使用#define进行
或者你建议使用
(静态?)const double。
您可以使用#define,但最好使用const double。
-
Ian Collins。
Ian Collins写道:
pereges写道:
>我需要将plancks定义为6.67 X 10 exp -34。是否可以使用#define进行,或者你建议使用
(静态?)const double。
您可以使用#define,但最好使用const double。
为什么?想一想。这样你就无法定义编译时间
常数。
-
[mail]:Chuck F(cbfalconer)在maineline dot net)
[page]:< http://cbfalconer.home.att.net>
尝试下载部分。
**发自 http://www.teranews.com ** >
I need to define the plancks constant 6.67 X 10 exp -34. Is it
possible to do it using #define or would you suggest using a
(static ?)const double.
In article <6f**********************************@w8g2000prd.g ooglegroups.com>,
pereges <Br*****@gmail.comwrote:>I need to define the plancks constant 6.67 X 10 exp -34. Is it
possible to do it using #define#define Planck 6.67e-34
--
"The beauties of conception are always superior to those of
expression." -- Walter J. Phillips
pereges wrote:I need to define the plancks constant 6.67 X 10 exp -34. Is it
possible to do it using #define or would you suggest using a
(static ?)const double.You could use #define, but it would be better to use a const double.
--
Ian Collins.
Ian Collins wrote:pereges wrote:
>I need to define the plancks constant 6.67 X 10 exp -34. Is it
possible to do it using #define or would you suggest using a
(static ?)const double.
You could use #define, but it would be better to use a const double.Why? Think about it. That way you can''t define compile time
constants.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
** Posted from http://www.teranews.com **
这篇关于#define是非常小的数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!