64位有符号整数有多大? [英] How big can a 64bit signed integer be?

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

问题描述

redis 中,



HINCRBY支持的值范围限制为64位有符号
整数。

The range of values supported by HINCRBY is limited to 64 bit signed integers.

我想知道64位有符号整数有多大。如果这是常识,我很抱歉,我的背景是经济学,没有人告诉我那里的问题答案。

And I'd like to know how big can that 64 bit signed integer be. I'm sorry if this is common knowledge, my background is Economics and no one told me the answer to the question there.

提前致谢:)

推荐答案

本文适用于有关此主题的更多信息: http://en.wikipedia.org/wiki/Integer_(computer_science)

This article is good for more information about this topic: http://en.wikipedia.org/wiki/Integer_(computer_science)

所以答案是问题应该是:
从-9,223,372,036,854,775,808到9,223,372,036,854,775,807,
或从 - (2 ^ 63)到2 ^ 63 - 1

So the answer to the question should be: From -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807, or from −(2^63) to 2^63 − 1

最高存储在signed int中的正数表示为二进制为

The highest positive number stored in a signed int is represented binary as

----- 63个-----

0111111111111111111111111111111111111111111111111111111111111111

如果你仔细想想你可以发现这个数字恰好是2 ^ 63 - 1。

If you think carefully you can find out that this number is exactly 2^63 - 1.

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

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