本文共 1071 字,大约阅读时间需要 3 分钟。
julia 数组类型转换
To determine the supertype of a type – we use the , it accepts a data type and returns the concrete supertype of the given type.
要确定类型的超类型 –我们使用 ,该接受数据类型并返回给定类型的具体超类型。
Example:
例:
# Julia example to determine the # supertype of a type in Juliaprintln("supertype(Bool): ", supertype(Bool))println("supertype(Char): ", supertype(Char))println("supertype(String): ", supertype(String))println()println("supertype(Int8): ", supertype(Int8))println("supertype(Int16): ", supertype(Int16))println("supertype(Int32): ", supertype(Int32))println("supertype(Int64): ", supertype(Int64))println()println("supertype(Float16): ", supertype(Float16))println("supertype(Float32): ", supertype(Float32))println("supertype(Float64): ", supertype(Float64))println()
Output
输出量
supertype(Bool): Integersupertype(Char): AbstractCharsupertype(String): AbstractStringsupertype(Int8): Signedsupertype(Int16): Signedsupertype(Int32): Signedsupertype(Int64): Signedsupertype(Float16): AbstractFloatsupertype(Float32): AbstractFloatsupertype(Float64): AbstractFloat
翻译自:
julia 数组类型转换
转载地址:http://wxtzd.baihongyu.com/