加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

julia-lang – 为什么typeof十六进制或二进制数Uint64而十进制数

发布时间:2020-12-14 01:48:47 所属栏目:Windows 来源:网络整理
导读:julia typeof(-0b111)Uint64julia typeof(-0x7)Uint64julia typeof(-7)Int64 我发现这个结果有点令人惊讶.为什么数字的数字基数确定了签名或未签名? 看起来这是预期的行为: This behavior is based on the observation that when one uses unsigned hex li
julia> typeof(-0b111)
Uint64

julia> typeof(-0x7)
Uint64

julia> typeof(-7)
Int64

我发现这个结果有点令人惊讶.为什么数字的数字基数确定了签名或未签名?

看起来这是预期的行为:

This behavior is based on the observation that when one uses unsigned
hex literals for integer values,one typically is using them to
represent a fixed numeric byte sequence,rather than just an integer
value.

http://docs.julialang.org/en/latest/manual/integers-and-floating-point-numbers/#integers

……似乎有点奇怪的选择.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读