亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Go規范中“無符號”,“有符號”和“虛數”的含義是什么?

Go規范中“無符號”,“有符號”和“虛數”的含義是什么?

Go
慕容3067478 2022-08-01 17:04:38
在Go中,有一個部分用于數字類型,但我不太清楚某些定義。在這種情況下,“無符號”,“所有有符號的集合”,“虛構部分”是什么意思?uint8       the set of all unsigned  8-bit integers (0 to 255)uint16      the set of all unsigned 16-bit integers (0 to 65535)uint32      the set of all unsigned 32-bit integers (0 to 4294967295)uint64      the set of all unsigned 64-bit integers (0 to 18446744073709551615)int8        the set of all signed  8-bit integers (-128 to 127)int16       the set of all signed 16-bit integers (-32768 to 32767)int32       the set of all signed 32-bit integers (-2147483648 to 2147483647)int64       the set of all signed 64-bit integers (-9223372036854775808 to 9223372036854775807)float32     the set of all IEEE-754 32-bit floating-point numbersfloat64     the set of all IEEE-754 64-bit floating-point numberscomplex64   the set of all complex numbers with float32 real and imaginary partscomplex128  the set of all complex numbers with float64 real and imaginary partsbyte        alias for uint8rune        alias for int32參考資料: https://golang.org/ref/spec#Numeric_types
查看完整描述

1 回答

?
墨色風雨

TA貢獻1853條經驗 獲得超6個贊

var x complex128 = complex(1, 2) // 1+2i

復數的最大值:complex128(1.7976931348623157e+308 + 1.7976931348623157e+308 i)

如果你熟悉復數,那么你可以理解它。否則這里 = 或iroot of (-1)i^2 = -1

無符號表示僅正數和 0。

uint64 系列0 to 18,446,744,073,709,551,615

uint32 范圍0 to 4,294,967,295

和平均值 從負到正的總數范圍set of signed


查看完整回答
反對 回復 2022-08-01
  • 1 回答
  • 0 關注
  • 137 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號