Skip to content

Upper limit of the number of fractional bits f #155

Description

@kimikage

In theory, the number of fractional bits f can be countlessly large, but what is the actual upper limit?
I assumed that it is 8sizeof(T)-1 for Fixed{T}, and 8sizeof(T) for Normed{T}.

However, the larger numbers are also used actually.

for (TI, f) in [(Int8, 8), (Int16, 8), (Int16, 10), (Int32, 16)]

F8 = Fixed{Int8,8}

x = Fixed{Int8,8}(0.3)

for T in (Fixed{Int8,8}, Fixed{Int16,8}, Fixed{Int16,10}, Fixed{Int32,16})

Perhaps some functions do not work properly with large f, due to implicit upper limits.

Edit:
I intend to support Fixed{T,f} where f == 8sizeof(T), i.e. throw no exceptions. However, they have no typealias and will not be tested enough.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions