Skip to content

Fix misleading statement regarding sign bit #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ For `T<:Signed` (a signed integer), there is a fixed-point type
`Normed{T, f}` type. However, there are slight differences in behavior
that go beyond signed/unsigned distinctions.

The `Fixed{T,f}` types use 1 bit for sign, and `f` bits to represent
the fraction. For example, `Fixed{Int8,7}` uses 7 bits (all bits
except the sign bit) for the fractional part. The value of the number
is interpreted as if the integer representation has been divided by
`2^f`. Consequently, `Fixed{Int8,7}` numbers `x` satisfy
The `Fixed{T,f}` types take the integer type `T` and simply shift the "decimal"
point (or more accurately, the [radix or binary
point](https://en.wikipedia.org/wiki/Decimal_separator#Radix_point)) `f` bits to
the left, i.e. they represent real numbers of the form `x::T / 2^f`.
Consequently, `Fixed{Int8,7}` numbers `x` satisfy

```julia
-1.0 = -128/128 ≤ x ≤ 127/128 ≈ 0.992.
Expand Down