简体   繁体   English

无法在 int64 C# 中保存 19 位数值

[英]Unable to hold 19 digit value in int64 C#

I have a long data type and i tried to pass below value.我有一个很长的数据类型,我试图传递以下值。

9947493585485901500 9947493585485901500

But i'm getting following error但我收到以下错误

Error converting value "9947493585485901500" to type 'System.Int64'. Path '[0].gId', line 1, position 108.

Can't int64 type hold the above value ? int64 类型不能保存上述值吗? if yes.then which data type should i use for this ?如果是,那么我应该为此使用哪种数据类型?

int64 is 64 bits. int64 是 64 位。 2^64 = 18446744073709551616 which is the maximum number of unique values that can be represented by 64 bits. 2^64 = 18446744073709551616 这是 64 位可以表示的唯一值的最大数量。

int64 need also represent negative numbers, halving that to 9223372036854775808 int64 还需要表示负数,将其减半为 9223372036854775808

You will need to use slightly lower numbers您将需要使用略低的数字

Information about C# ranges and sizes of data types you can find in documentation .您可以在文档中找到有关 C# 范围和数据类型大小的信息。 Range for int64 is -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 . int64 的范围是-9,223,372,036,854,775,8089,223,372,036,854,775,807

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM