julia> Integer <: Real
true
Run Code Online (Sandbox Code Playgroud)
如果我们不知道答案 ( Real) 如何找到 的超类型Integer?
另外,如何找到 的所有子类型Integer?
julia> supertype(Integer)
Real
julia> subtypes(Integer)
3-element Array{Any,1}:
Bool
Signed
Unsigned
Run Code Online (Sandbox Code Playgroud)
另见https://github.com/JuliaLang/julia/issues/24741
| 归档时间: |
|
| 查看次数: |
339 次 |
| 最近记录: |