Skip to content

Commit 5cf7bd9

Browse files
committed
Improve formatting of examples table
1 parent baef92a commit 5cf7bd9

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ extracts the base numeric type from a possible container type `T`:
1212

1313
For 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

2727
Packages should write a method to `base_numeric_type`
2828
when the base numeric type of a container type

src/BaseType.jl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ export base_numeric_type
99
Extract the base numeric type from a possible container type `T`.
1010
1111
For 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

0 commit comments

Comments
 (0)