Skip to content

Commit c58f4a3

Browse files
authored
Merge pull request #68 from JuliaMath/vc/readme
update README to reflect compact syntax
2 parents 7188a96 + f698a37 commit c58f4a3

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,19 @@ because the range of `Int8` is from -128 to 127.
4545

4646
In contrast, the `Normed{T,f}`, with `f` fraction bits, map the closed
4747
interval [0.0,1.0] to the span of numbers with `f` bits. For example,
48-
the `Normed8` type (aliased to `Normed{UInt8,8}`) is represented
48+
the `N0f8` type (aliased to `Normed{UInt8,8}`) is represented
4949
internally by a `UInt8`, and makes `0x00` equivalent to `0.0` and
5050
`0xff` to `1.0`. Consequently, `Normed` numbers are scaled by `2^f-1`
51-
rather than `2^f`. The type aliases `Normed10`, `Normed12`,
52-
`Normed14`, and `Normed16` are all based on `UInt16` and reach the
51+
rather than `2^f`. The type aliases `N6f10`, `N4f12`,
52+
`N2f14`, and `N0f16` are all based on `UInt16` and reach the
5353
value `1.0` at 10, 12, 14, and 16 bits, respectively (`0x03ff`,
54-
`0x0fff`, `0x3fff`, and `0xffff`).
54+
`0x0fff`, `0x3fff`, and `0xffff`). The `NXfY` notation is used for
55+
compact printing and the `fY` component informs about the number of
56+
fractional bits and `X+Y` equals the number of underlying bits used.
5557

56-
To construct such a number, use `convert(Normed12, 1.3)`, `Normed12(1.3)`, `Normed{UInt16,12}(1.3)`, or the literal syntax
57-
`0x14ccuf12`. The latter syntax means to construct a `Normed12` (it ends in
58+
To construct such a number, use `convert(N4f12, 1.3)`, `N4f12(1.3)`,
59+
`Normed{UInt16,12}(1.3)`, or `reinterpret(N4f12, 0x14cc)`.
60+
The latter syntax means to construct a `N4f12` (it ends in
5861
`uf12`) from the `UInt16` value `0x14cc`.
5962

6063
More generally, an arbitrary number of bits from any of the standard unsigned

0 commit comments

Comments
 (0)