Skip to content

Why not represent bit count as integer? #97

@florisla

Description

@florisla

Hi,

I find this a bit unintuitive:

>>> bitmath.KiB(1/3).to_Bit()
Bit(2730.6666666666665)

I would expect this to throw an exception (I did not specify an integer count of bytes).

There seems to be a precision of 12 decimals, but a bit is non-divisible. So 0.666 bit is not a quantity of bits which can exist.

What is the purpose of using floating point sizes in bitmath, when you could represent bit count as an integer everywhere?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions