Go 101 (Golang 101) v1.21.0
one boolean built-in boolean type: bool. 11 built-in integer numeric types (basic integer types): int8, uint8, int16, uint16, int32, uint32, int64, uint64, int, uint, and uintptr. two built-in floating-point occupies 8 bits in memory. So the largest uint8 value is 255 (28-1), the largest int8 value is 127 (27-1), and the smallest int8 value is -128 (-27). If a value occupies N bits in memory, we say the size Values the Literal Can Represent 256 All basic numeric types except int8 and uint8 types. 255 All basic numeric types except int8 types. -123 All basic numeric types except the unsigned ones. 123 All0 码力 | 610 页 | 945.17 KB | 1 年前3Go 101 (Golang 101) v1.21.0
one boolean built-in boolean type: bool. 11 built-in integer numeric types (basic integer types): int8, uint8, int16, uint16, int32, uint32, int64, uint64, int, uint, and uintptr. two built-in floating-point occupies 8 bits in memory. So the largest uint8 value is 255 (28-1), the largest int8 value is 127 (27-1), and the smallest int8 value is -128 (-27). If a value occupies N bits in memory, we say the size Values the Literal Can Represent 256 All basic numeric types except int8 and uint8 types. 255 All basic numeric types except int8 types. -123 All basic numeric types except the unsigned ones. 1230 码力 | 880 页 | 833.34 KB | 1 年前3Golang 101(Go语言101 中文版) v1.21.a
这篇文章将介绍内置(或称为预声明的)基本类型和它们字面量的表示形式。 本篇文章不介绍组合类型。 基本内置类型 Go支持如下内置基本类型: 一种内置布尔类型:bool。 11种内置整数类型:int8、uint8、int16、uint16、int32、uint32、 int64、uint64、int、uint和uintptr。 两种内置浮点数类型:float32和float64。 两种内 位(以后简称位)。二进制位常称为比特(bit)。 比如,一个uint8的值将占 有8位。 我们称uint8类型的值的尺寸是8位。 因此,最大的uint8值是255 (28-1), 最大的int8值是127(27-1), 最小的int8值是-128(-27)。 任一个类型的所有值的尺寸都是相同的,所以一个值的尺寸也常称为它的类型 的尺寸。 更多的时候,我们使用字节(byte)做为值尺寸的度量单位。 一个字节相当于 能够表示的数值范围(溢出),则在编译时刻,此字面量不能用来表示此类型 的值。 下表是一些例子: 字面表示 此字面表示可以表示哪些类型的值(在编译时刻) 256 除了int8和uint8类型外的所有的基本数值类型。 255 除了int8类型外的所有的基本数值类型。 -123 除了无符号整数类型外的所有的基本数值类型。 123 所有的基本数值类型。 123.000 1.23e2 'a'0 码力 | 821 页 | 956.82 KB | 1 年前3Golang 101(Go语言101 中文版) v1.21.a
这篇文章将介绍内置(或称为预声明的)基本类型和它们字面量的表示形式。 本篇文章不介绍组合类型。 基本内置类型 Go支持如下内置基本类型: 一种内置布尔类型:bool。 11种内置整数类型: int8、 uint8、 int16、 uint16、 int32、 uint32、 int64、uint64、int、uint和uintptr。 两种内置浮点数类型:float32和float64。 位(以后简称位)。二进制位常称为比特(bit)。 比如,一个uint8的值将占 有8位。 我们称uint8类型的值的尺寸是8位。 因此,最大的uint8值是255(28- 1), 最大的int8值是127(27-1), 最小的int8值是-128(-27)。 任一个类型的所有值的尺寸都是相同的,所以一个值的尺寸也常称为它的类型 的尺寸。 更多的时候,我们使用字节(byte)做为值尺寸的度量单位。 一个字节相当于8 够表示的数值范围(溢出),则在编译时刻,此字面量不能用来表示此类型的 值。 下表是一些例子: 字面表示 此字面表示可以表示哪些类型的值(在编译时刻) 256 除了int8和uint8类型外的所有的基本数值类型。 255 除了int8类型外的所有的基本数值类型。 -123 除了无符号整数类型外的所有的基本数值类型。 123 所有的基本数值类型。 123.000 1.23e2 'a' 10 码力 | 608 页 | 1.08 MB | 1 年前3Computer Programming with the Nim Programming Language
sizes. Besides the int data type, Nim has some more data types for signed and unsigned integers: int8, int16, int32, and int64 are signed types with well-defined bit and byte size, and uint8, uint16 may have to do type conversion in that case before the math operation can be applied. Adding two int8 types on some CPUs can be slower than adding two ints, because the CPU may have to size extend the backend, is that unsigned integers do not generate overflow errors but simply wrap around: var x: int8 = 0 while true: inc(x) echo x The code above would print the numbers 0 through 127, then terminate0 码力 | 865 页 | 7.45 MB | 1 年前3Computer Programming with the Nim Programming Language
sizes. Besides the int data type, Nim has some more data types for signed and unsigned integers: int8, int16, int32, and int64 are signed types with well-defined bit and byte size, and uint8, uint16 may have to do type conversion in that case before the math operation can be applied. Adding two int8 types on some CPUs can be slower than adding two ints, because the CPU may have to size extend the backend, is that unsigned integers do not generate overflow errors but simply wrap around: var x: int8 = 0 while true: inc(x) echo x The code above would print the numbers 0 through 127, then terminate0 码力 | 784 页 | 2.13 MB | 1 年前3Django 1.10.x Documentation
>>> rst.srs.srid 4326 >>> rst.width, rst.height (1, 2) >>> rst.bands[0].data() array([[0, 1]], dtype=int8) GDALRaster objects can now be instantiated directly from raw data. Setters have been added for the [ 8, 9, 10, 11], [12, 13, 14, 15]], dtype=int8) >>> bnd.data(offset=(1, 1), size=(2, 2)) array([[ 5, 6], [ 9, 10]], dtype=int8) >>> bnd.data(data=[-1, -2, -3, -4], offset=(1, 1), size=(2 0, 1, 2, 3], [ 4, -1, -2, 7], [ 8, -3, -4, 11], [12, 13, 14, 15]], dtype=int8) >>> bnd.data(data='\x9d\xa8\xb3\xbe', offset=(1, 1), size=(2, 2)) >>> bnd.data() array([[ 0, 10 码力 | 2538 页 | 2.59 MB | 1 年前3Django 1.11.x Documentation
[ 8, 9, 10, 11], [12, 13, 14, 15]], dtype=int8) >>> bnd.data(offset=(1, 1), size=(2, 2)) array([[ 5, 6], [ 9, 10]], dtype=int8) >>> bnd.data(data=[-1, -2, -3, -4], offset=(1, 1), size=(2 0, 1, 2, 3], [ 4, -1, -2, 7], [ 8, -3, -4, 11], [12, 13, 14, 15]], dtype=int8) >>> bnd.data(data='\x9d\xa8\xb3\xbe', offset=(1, 1), size=(2, 2)) >>> bnd.data() array([[ 0, 1 3], [ 4, -99, -88, 7], [ 8, -77, -66, 11], [ 12, 13, 14, 15]], dtype=int8) >>> bnd.data([1], shape=(1, 1)) >>> bnd.data() array([[1, 1, 1, 1], [1, 1, 1, 1], [10 码力 | 2747 页 | 2.67 MB | 1 年前3Django 2.1.x Documentation
[ 8, 9, 10, 11], [12, 13, 14, 15]], dtype=int8) >>> bnd.data(offset=(1, 1), size=(2, 2)) array([[ 5, 6], [ 9, 10]], dtype=int8) >>> bnd.data(data=[-1, -2, -3, -4], offset=(1, 1), size=(2 0, 1, 2, 3], [ 4, -1, -2, 7], [ 8, -3, -4, 11], [12, 13, 14, 15]], dtype=int8) >>> bnd.data(data='\x9d\xa8\xb3\xbe', offset=(1, 1), size=(2, 2)) >>> bnd.data() array([[ 0, 1 3], [ 4, -99, -88, 7], [ 8, -77, -66, 11], [ 12, 13, 14, 15]], dtype=int8) >>> bnd.data([1], shape=(1, 1)) >>> bnd.data() array([[1, 1, 1, 1], [1, 1, 1, 1], [10 码力 | 2790 页 | 2.71 MB | 1 年前3Django 2.2.x Documentation
[ 8, 9, 10, 11], [12, 13, 14, 15]], dtype=int8) >>> bnd.data(offset=(1, 1), size=(2, 2)) array([[ 5, 6], [ 9, 10]], dtype=int8) >>> bnd.data(data=[-1, -2, -3, -4], offset=(1, 1), size=(2 0, 1, 2, 3], [ 4, -1, -2, 7], [ 8, -3, -4, 11], [12, 13, 14, 15]], dtype=int8) >>> bnd.data(data='\x9d\xa8\xb3\xbe', offset=(1, 1), size=(2, 2)) >>> bnd.data() array([[ 0, 1 3], [ 4, -99, -88, 7], [ 8, -77, -66, 11], [ 12, 13, 14, 15]], dtype=int8) >>> bnd.data([1], shape=(1, 1)) >>> bnd.data() array([[1, 1, 1, 1], [1, 1, 1, 1], [10 码力 | 2915 页 | 2.83 MB | 1 年前3
共 31 条
- 1
- 2
- 3
- 4