#define是非常小的数字? [英] #define for very small numbers ?

查看:76
本文介绍了#define是非常小的数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将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屋!

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