Skip to content

Commit 09c21a1

Browse files
vk2sebzyp
authored andcommitted
fixed.Value: add numerator() method, a signedness-preserving as_value()
1 parent 5eaba6c commit 09c21a1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

text/0041-fixed-point.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ The following operations are defined on it:
5555
- `.i_bits`, `.f_bits`, `.signed`: Width and signedness properties.
5656
- `.shape()`: Return the `fixed.Shape` this was created from.
5757
- `.as_value()`: Return the underlying value.
58+
- `.numerator()`: Return `as_value()` cast to the appropriate signedness.
5859
- `.eq(value)`: Assign `value`.
5960
- If `value` is a `Value`, it'll be assigned directly to the underlying `Value`.
6061
- If `value` is an `int` or `float`, it'll be cast to a `fixed.Const` first.

0 commit comments

Comments
 (0)