数字太大了 [英] number too large

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

问题描述

嘿,我希望我能得到这方面的帮助。

Hey , i hope i get help with this.

我是rsps的编码器(runescape私人服务器)

im a coder of a rsps (runescape private server)

并且在这个游戏中你可以拥有物品和武器

and in this game you could like have items and weapons

你可以拥有的物品的最大安装量是2147000000

and the max anmount of a item you can have is 2147000000

我可以通过更改此int来更改最大金额

and i can change the amount of the max by changing this int

public int maxItemAmount = 2147000000;

它有效

但我想要使它像3000000000

but i want to make it like 3000000000

我这样做

public int maxItemAmount = 3000000000;

当我编译时我得到这个错误

and when i compile i get this error

integrer number too large: 3000000000

请各位帮助我如果可以的话:):

please guys help me out if you can :)

推荐答案

整数的上限为2 ^ 31(2147483648)。如果你想要的数字比这长,你可以使用长或双。

Integer has an upper bound of 2^31 (2147483648). If you want numbers longer than that, you can use a long or double.

这篇关于数字太大了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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