Jonny-exe/binary-fractions

(More of just a question than an "issue") Is there a way to specify a lower precision than 128?

Closed this issue · 1 comments

I am very happy with this binary-fractions package! Thank you for your great work on this.

My question is just a "usage" query: is there any way to specify a precision of less than 128? In a few isolated cases, I want 64-, 32-, and even 16-bit precision.

I see that ndigits is an argument of the TwosComplement __new__ constructor, but that value is not passed in to the TwosComplement constructor from the Binary __init__ initializer.

But perhaps am I missing something about how __new__ works in python?

Anyway, I'd just like to be able to use a different precision in certain cases.

Thank you in advance for any suggestions.

scastd commented

My question is just a "usage" query: is there any way to specify a precision of less than 128? In a few isolated cases, I want 64-, 32-, and even 16-bit precision.

I see that ndigits is an argument of the TwosComplement new constructor, but that value is not passed in to the TwosComplement constructor from the Binary init initializer.

You have to download the last version of the library directly from the master branch, or update it in your local package code directly.

I opened a pull request for the same reason, and now it is fixed (#2).

Hope that helps!