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

查看:30
本文介绍了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.

推荐答案

这篇文章很好地提供了有关此主题的更多信息: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

存储在有符号整数中的最高正数用二进制表示为

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天全站免登陆