Skip to content

Commit eacd940

Browse files
committed
feat: Add fixed-point number data type proposals
This commit introduces Zarr extension proposals for binary fixed-point numbers, based on the FixedPointNumbers.jl library. - Adds dedicated directories and READMEs for Qmfn and Nmfn fixed-point types across 8-bit, 16-bit, 32-bit, and 64-bit integer underlying types. - READMEs include detailed configuration, range, fill value representation, codec compatibility, Rust crate mapping (fixed and q-num), and maintainer information. - Renames 'fixed_point' directory to 'fixed-point' for consistency. - Adjusts the notation explanation to consistently use 'n' for fractional bits and clarifies Rust crate mappings. - Adds a note about potential 128-bit extensions.
1 parent 6ca3baa commit eacd940

File tree

481 files changed

+9421
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

481 files changed

+9421
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# N0f16
2+
3+
An unsigned 16-bit "normed" fixed-point number with 16 fractional bits.
4+
5+
**Status:** proposal
6+
7+
## Data type name
8+
9+
`N0f16`
10+
11+
## Configuration
12+
13+
This data type represents an unsigned "normed" fixed-point number based on an underlying 16-bit integer.
14+
- **base_type**: `uint16`
15+
- **f**: 16 (number of fractional bits)
16+
- **scaling**: by `2^f - 1`
17+
- **range**: `0.0` to `1.0`
18+
19+
The stored `UInt16` value `i` is interpreted as `i / (2^16 - 1)`. This is equivalent to `Normed{UInt16, 16}` in `FixedPointNumbers.jl`.
20+
21+
## Fill value representation
22+
23+
The `fill_value` for this data type should be represented as a floating-point number in the JSON metadata.
24+
25+
## Codec compatibility
26+
27+
This data type is stored as an `uint16`. It is expected to be compatible with any codec that can handle the `uint16` data type.
28+
29+
## See also
30+
31+
- [`fixed_point/` directory](../) for other fixed-point types.
32+
- [FixedPointNumbers.jl](https://github.com/JuliaMath/FixedPointNumbers.jl)
33+
34+
## Current maintainers
35+
36+
- Mark Kittisopikul (@mkitti), Howard Hughes Medical Institute
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "N0f16"
3+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# N0f32
2+
3+
An unsigned 32-bit "normed" fixed-point number with 32 fractional bits.
4+
5+
**Status:** proposal
6+
7+
## Data type name
8+
9+
`N0f32`
10+
11+
## Configuration
12+
13+
This data type represents an unsigned "normed" fixed-point number based on an underlying 32-bit integer.
14+
- **base_type**: `uint32`
15+
- **f**: 32 (number of fractional bits)
16+
- **scaling**: by `2^f - 1`
17+
- **range**: `0.0` to `1.0`
18+
19+
The stored `UInt32` value `i` is interpreted as `i / (2^32 - 1)`. This is equivalent to `Normed{UInt32, 32}` in `FixedPointNumbers.jl`.
20+
21+
## Fill value representation
22+
23+
The `fill_value` for this data type should be represented as a floating-point number in the JSON metadata.
24+
25+
## Codec compatibility
26+
27+
This data type is stored as an `uint32`. It is expected to be compatible with any codec that can handle the `uint32` data type.
28+
29+
## See also
30+
31+
- [`fixed_point/` directory](../) for other fixed-point types.
32+
- [FixedPointNumbers.jl](https://github.com/JuliaMath/FixedPointNumbers.jl)
33+
34+
## Current maintainers
35+
36+
- Mark Kittisopikul (@mkitti), Howard Hughes Medical Institute
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "N0f32"
3+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# N0f64
2+
3+
An unsigned 64-bit "normed" fixed-point number with 64 fractional bits.
4+
5+
**Status:** proposal
6+
7+
## Data type name
8+
9+
`N0f64`
10+
11+
## Configuration
12+
13+
This data type represents an unsigned "normed" fixed-point number based on an underlying 64-bit integer.
14+
- **base_type**: `uint64`
15+
- **f**: 64 (number of fractional bits)
16+
- **scaling**: by `2^f - 1`
17+
- **range**: `0.0` to `1.0`
18+
19+
The stored `UInt64` value `i` is interpreted as `i / (2^64 - 1)`. This is equivalent to `Normed{UInt64, 64}` in `FixedPointNumbers.jl`.
20+
21+
## Fill value representation
22+
23+
The `fill_value` for this data type should be represented as a floating-point number in the JSON metadata.
24+
25+
## Codec compatibility
26+
27+
This data type is stored as an `uint64`. It is expected to be compatible with any codec that can handle the `uint64` data type.
28+
29+
## See also
30+
31+
- [`fixed_point/` directory](../) for other fixed-point types.
32+
- [FixedPointNumbers.jl](https://github.com/JuliaMath/FixedPointNumbers.jl)
33+
34+
## Current maintainers
35+
36+
- Mark Kittisopikul (@mkitti), Howard Hughes Medical Institute
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "N0f64"
3+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# N0f8
2+
3+
An unsigned 8-bit "normed" fixed-point number with 8 fractional bits.
4+
5+
**Status:** proposal
6+
7+
## Data type name
8+
9+
`N0f8`
10+
11+
## Configuration
12+
13+
This data type represents an unsigned "normed" fixed-point number based on an underlying 8-bit integer.
14+
- **base_type**: `uint8`
15+
- **f**: 8 (number of fractional bits)
16+
- **scaling**: by `2^f - 1`
17+
- **range**: `0.0` to `1.0`
18+
19+
The stored `UInt8` value `i` is interpreted as `i / (2^8 - 1)`. This is equivalent to `Normed{UInt8, 8}` in `FixedPointNumbers.jl`. This maps the integer range `0..255` to the floating point range `0.0..1.0`.
20+
21+
## Fill value representation
22+
23+
The `fill_value` for this data type should be represented as a floating-point number in the JSON metadata. For example: `"fill_value": 0.5`.
24+
25+
## Codec compatibility
26+
27+
This data type is stored as a `uint8`. It is expected to be compatible with any codec that can handle the `uint8` data type.
28+
29+
## See also
30+
31+
- [`fixed_point/` directory](../) for other fixed-point types.
32+
- [FixedPointNumbers.jl](https://github.com/JuliaMath/FixedPointNumbers.jl)
33+
34+
## Current maintainers
35+
36+
- Mark Kittisopikul (@mkitti), Howard Hughes Medical Institute
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "N0f8"
3+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# N10f22
2+
3+
An unsigned 32-bit "normed" fixed-point number with 22 fractional bits.
4+
5+
**Status:** proposal
6+
7+
## Data type name
8+
9+
`N10f22`
10+
11+
## Configuration
12+
13+
This data type represents an unsigned "normed" fixed-point number based on an underlying 32-bit integer.
14+
- **base_type**: `uint32`
15+
- **f**: 22 (number of fractional bits)
16+
- **scaling**: by `2^f - 1`
17+
- **range**: `0.0` to `1024.0002439`
18+
19+
The stored `UInt32` value `i` is interpreted as `i / (2^22 - 1)`. This is equivalent to `Normed{UInt32, 22}` in `FixedPointNumbers.jl`.
20+
21+
## Fill value representation
22+
23+
The `fill_value` for this data type should be represented as a floating-point number in the JSON metadata.
24+
25+
## Codec compatibility
26+
27+
This data type is stored as an `uint32`. It is expected to be compatible with any codec that can handle the `uint32` data type.
28+
29+
## See also
30+
31+
- [`fixed_point/` directory](../) for other fixed-point types.
32+
- [FixedPointNumbers.jl](https://github.com/JuliaMath/FixedPointNumbers.jl)
33+
34+
## Current maintainers
35+
36+
- Mark Kittisopikul (@mkitti), Howard Hughes Medical Institute
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "N10f22"
3+
}

0 commit comments

Comments
 (0)