File tree Expand file tree Collapse file tree 2 files changed +23
-21
lines changed
Expand file tree Collapse file tree 2 files changed +23
-21
lines changed Original file line number Diff line number Diff line change @@ -12,17 +12,17 @@ extracts the base numeric type from a possible container type `T`:
1212
1313For example,
1414
15- ``` julia
16- [
17- Float32 => Float32,
18- Array{Float64, 1 } => Float64,
19- ComplexF64 => Float64,
20- Vector{ComplexF64} => ComplexF64,
21- Dual{BigFloat} => BigFloat,
22- Quantity{Int64,Dimensions} => Int64,
23- Measurement{Float32} => Float32,
24- ]
25- ```
15+ | Input Type | Output Type |
16+ | --- | --- |
17+ | ` Float32 ` | ` Float32 ` |
18+ | ` ComplexF32 ` | ` Float32 ` |
19+ | ` Array{ComplexF32,1} ` | ` ComplexF32 ` |
20+ | ` Set{Float32} ` | ` Float32 ` |
21+ | ` Measurement{Float32} ` | ` Float32 ` |
22+ | ` Dual{BigFloat} ` | ` BigFloat ` |
23+ | ` Rational{Int8} ` | ` Int8 ` |
24+ | ` Dict{Int64,Float64} ` | ` Int64 ` |
25+ | ` Quantity{Float32,Dimensions} ` | ` Float32 ` |
2626
2727Packages should write a method to ` base_numeric_type `
2828when the base numeric type of a container type
Original file line number Diff line number Diff line change @@ -9,16 +9,18 @@ export base_numeric_type
99Extract the base numeric type from a possible container type `T`.
1010
1111For example,
12- ```julia
13- [
14- Float32 => Float32,
15- Float32 => Float32,
16- Array{Float64,1} => Float64,
17- ComplexF64 => Float64,
18- Dual{Int64} => Int64,
19- Quantity{Float32} => Float32,
20- ]
21- ```
12+
13+ | Input Type | Output Type |
14+ |---|---|
15+ | `Float32` | `Float32` |
16+ | `ComplexF32` | `Float32` |
17+ | `Array{ComplexF32,1}` | `ComplexF32` |
18+ | `Set{Float32}` | `Float32` |
19+ | `Measurement{Float32}` | `Float32` |
20+ | `Rational{Int8}` | `Int8` |
21+ | `Dict{Int64,Float64}` | `Int64` |
22+ | `Dual{BigFloat}` | `BigFloat` |
23+ | `Quantity{Float32,Dimensions}` | `Float32` |
2224"""
2325@generated function base_numeric_type (:: Type{T} ) where {T}
2426 params = T isa UnionAll ? T. body. parameters : T. parameters
You can’t perform that action at this time.
0 commit comments