int64或double

int64或double

问题描述:

VB2003。我需要一个大的正整数。哪个是更大的int64或双倍?


我看到int64显然也被称为长期并且将持有

-9,223,372,036,854,775,808到9,223,372,036,854,775,807。


但我对E +不好当我被告知双重持有时表示

-1.79769313486231570E + 308至

-4.94065645841246544E-324为负值; 4.94065645841246544E-324

至1.79769313486231570E + 308为正值。


这是什么意思?是-1.79769313486231570E + 308 =

-1.79769313486231570 X无论1后面有308个零点是什么?


加上双倍似乎没有1, 2,3,4,5等导致它给出两个

范围。


对不起,我一直觉得数学是让计算机弄清楚不是我。

VB2003. I need a large positive integer. Which is larger int64 or double?

I see int64 also apparently is known as long and will hold
-9,223,372,036,854,775,808 through 9,223,372,036,854,775,807.

But I''m not good with the E+??? notation so when I''m told double holds
-1.79769313486231570E+308 through
-4.94065645841246544E-324 for negative values; 4.94065645841246544E-324
through 1.79769313486231570E+308 for positive values.

What does that mean? is -1.79769313486231570E+308 =
-1.79769313486231570 X whatever 1 with 308 zeros behind it is?

Plus double doesn''t seem to hold 1, 2, 3, 4, 5 etc cause it gives two
ranges.

Sorry, I always felt math was for the computer to figure out not me.

Double.MaxValue应该足够大。


+308表示你有多少次将小数点转移到

右边(就像你将10倍乘以308倍)。试着写一下

这个:

MsgBox(1E1)


你的编译器看看会发生什么;-)


-t

Double.MaxValue should be large enough.

the +308 means how many times you have to shift the decimal period to
the right (like if you multiply times 10 raised to 308). Try writing
this:
MsgBox(1E1)

in your compiler and see what happens ;-)

-t


" cj" < cj@nospam.nospam>在消息中写道

news:ez ************** @ TK2MSFTNGP03.phx.gbl ...
"cj" <cj@nospam.nospam> wrote in message
news:ez**************@TK2MSFTNGP03.phx.gbl...
VB2003。我需要一个大的正整数。哪个更大的int64或
加倍?


Double更大 - 但它缺少整数

变量的精度。整数是准确的。浮点数

只是近似值。所以,你需要一个确切的表示或

将近似吗?

我看到int64显然也被称为长期并将
持有-9,223,372,036,854,775,808到9,223,372,036,854,775,807 。


这够大吗?如果是,请使用它。如果没有看看

十进制类型以及Double。

但是我对E +不好当我被告知双重持有时,表示为负数值的情况下,请注意-1.79769313486231570E + 308至
-4.94065645841246544E-324; 4.94065645841246544E-324
到1.79769313486231570E + 308为正值。

这是什么意思?是-1.79769313486231570E + 308 = -1.79769313486231570
X后面有308个零的1是什么?

加上双倍似乎不能容纳1,2,3,4,5等因为它有两个
范围。

对不起,我一直觉得数学是让计算机弄清楚不是我。
VB2003. I need a large positive integer. Which is larger int64 or
double?
Double is larger - but it lacks the precision of integer
variables. Integers are exact. Floating point numbers
are only close approximations. So, do you need an exact representation or
will an approximation do?
I see int64 also apparently is known as long and will
hold -9,223,372,036,854,775,808 through 9,223,372,036,854,775,807.
Is this large enough? If it is, use it. If not take a look at the
Decimal type as well as Double.
But I''m not good with the E+??? notation so when I''m told double holds
-1.79769313486231570E+308 through
-4.94065645841246544E-324 for negative values; 4.94065645841246544E-324
through 1.79769313486231570E+308 for positive values.

What does that mean? is -1.79769313486231570E+308 = -1.79769313486231570
X whatever 1 with 308 zeros behind it is?

Plus double doesn''t seem to hold 1, 2, 3, 4, 5 etc cause it gives two
ranges.

Sorry, I always felt math was for the computer to figure out not me.




你怎么知道电脑是否给你正确答案?


-

Charles Appel
http://charlesappel.home.mindspring.com/

查克的故乡''德尔福的扑克图书馆,

查克的视频扑克和查克的玩具



How will you know if the computer is giving you the right answer?

--
Charles Appel
http://charlesappel.home.mindspring.com/
Home of Chuck''s Poker Libraries for Delp
Chuck''s Video Poker and Chuck''s Toys




" ; Charles Appel &LT; CH ********** @ mindspring.com&GT;在消息中写道

news:uZ ************** @ TK2MSFTNGP03.phx.gbl ...

"Charles Appel" <ch**********@mindspring.com> wrote in message
news:uZ**************@TK2MSFTNGP03.phx.gbl...
" cj" &LT; cj@nospam.nospam>在消息中写道
新闻:ez ************** @ TK2MSFTNGP03.phx.gbl ...
"cj" <cj@nospam.nospam> wrote in message
news:ez**************@TK2MSFTNGP03.phx.gbl...
VB2003。我需要一个大的正整数。哪个是更大的int64或
double?
VB2003. I need a large positive integer. Which is larger int64 or
double?



Double更大 - 但它缺乏整数
变量的精度。整数是准确的。浮点数
只是近似值。所以,你需要一个精确的表示或
将近似吗?



Double is larger - but it lacks the precision of integer
variables. Integers are exact. Floating point numbers
are only close approximations. So, do you need an exact representation or
will an approximation do?

我看到int64显然也被称为长期并将
持有-9,223,372,036,854,775,808到9,223,372,036,854,775,807 。
I see int64 also apparently is known as long and will
hold -9,223,372,036,854,775,808 through 9,223,372,036,854,775,807.



这够大吗?如果是,请使用它。如果没有看看
Decimal类型以及Double。



Is this large enough? If it is, use it. If not take a look at the
Decimal type as well as Double.

但我对E +不好当我被告知双重持有时,表示为负数值的情况下,请注意-1.79769313486231570E + 308至
-4.94065645841246544E-324; 4.94065645841246544E-324
到1.79769313486231570E + 308为正值。

这是什么意思?是-1.79769313486231570E + 308
= -1.79769313486231570 X无论1后面有308个零点是什么?

加上双倍似乎不能容纳1,2,3,4,5等因为它有两个范围。

对不起,我一直觉得数学是让计算机弄清楚不是我。
But I''m not good with the E+??? notation so when I''m told double holds
-1.79769313486231570E+308 through
-4.94065645841246544E-324 for negative values; 4.94065645841246544E-324
through 1.79769313486231570E+308 for positive values.

What does that mean? is -1.79769313486231570E+308 = -1.79769313486231570 X whatever 1 with 308 zeros behind it is?

Plus double doesn''t seem to hold 1, 2, 3, 4, 5 etc cause it gives two
ranges.

Sorry, I always felt math was for the computer to figure out not me.



你怎么知道如果计算机给你正确答案?

- 查尔斯·阿佩尔
http://charlesappel.home.mindspring.com/
查克的德尔福扑克图书馆之家,
查克的视频扑克和查克的玩具



How will you know if the computer is giving you the right answer?

--
Charles Appel
http://charlesappel.home.mindspring.com/
Home of Chuck''s Poker Libraries for Delp
Chuck''s Video Poker and Chuck''s Toys




除了查尔斯的评论......

请注意,虽然Double可以超过300 精确的数字,

只有前16个左右的数字是准确的。这可能会导致很长的讨论,但是虽然你可能得到一个很长的数字,但它实际上只是一个近似值,其中前16个数字左右是

准确。

注意他们如何描述限制:

1.79769313486231570E + 308正值

他们使用这种表示法是有原因的。只有列出的数字可以认为接近准确,其他291位数字可以显示。只是

近似值。


你首先说你需要一个非常大的正整数。那么,如果

就是你需要的,那么你应该坚持使用整数。回去并且

可能会导致你失去准确性。


Gerald



In addition to Charles'' comments...
Note that while a Double can have in excessive 300 digits of "precision",
only the first 16 or so digits are "accurate". This can lead to a very long
discussion, but while you might be able to get a very long number, it is
really only an approximation, of which the first 16 digits or so are
accurate.
Note how they described the limits:
1.79769313486231570E+308 for positive values
They use that notation for a reason. Only the digits listed could be
considered close to accurate, the other 291 digits it can "display" are only
an approximation.

You started by saying that you need a very large positive Integer. Well, if
that is what you need, then you should stick with Integers. Going back and
forth can cause you to lose accuracy.

Gerald