A python library for fractional fixed-point (base 2) arithmetic and binary manipulation with Numpy compatibility.
from_bin
method and function. Set value or create new Fxp from a binary string (issue #49).config.op_input_size='best'
when power operation has an constant operator (non-Fxp). Add warning message. (issue #89).prefix
for binary and hexadecimal representations.cumsum
function bug when dealing with sizes bigger than 32 bits (windows) / 64 bits (linux) (issue #76).numpy.reshape
function handling. This function was returning optimal size instead of same by default (issue #77).dtype
string (issue #80).#41 #48 #49 #76 #77 #80 #89
@desvdp @edschofield @nfrancque @Ethan-lsh @alb-pol @jrmoserbaltimore for reporting fixed issues and everyone else whose issues are still open.
abs
method.Thanks to: @DanChianucci for issue #60
truediv
and floordiv
methods (issue #53).Thanks to: @ruoting0103 , @mousecat98
resize
method.get_dtype
to get dtype using argument notation
.get_dtype
, resize
, reshape
, flatten
, set_val
, astype
, get_val
, raw
, uraw
, equal
reshape
and flatten methods.@qarlosalberto (issue #45)
thanks to @desvdp
config
as optional init parameter (kwarg).functions.truediv
with numpy.divide
.axes
parameter to transpose
method.Issues fixed: #26, #31
add
, sub
, mult
, truediv
, floordiv
, mod
and pow
functions and methods (operators).tuples
, Decimal
type from decimal
module.fxp
format or Q
format (it replaces explicit sizing by signed, n_word, and n_frac parameters).max_error
, n_word_max
. Parameters to define n_word and n_frac of a new Fxp.op_method
(defines calculation method for ALU operators).op_input_size
(defines sizing of constant conversion to Fxp in math operations).op_out
, op_out_like
, op_sizing
(define the sizing method or type for results of ALU operations).const_op_sizing
(alternative of op_sizing
when one of ALU operands is a constant).array_output_type
(defines the object type when use Numpy functions: Numpy Array or Fxp),
array_op_out
, array_op_out_like
(define the output's size), array_op_method
(defines calculation method for ALU operators).float
to int
to support extended precision.like
initialization supports overwrite of size parameters.bool
, int
, float
and complex
casting.on_value_change
, on_status_overflow
, on_status_underflow
, on_status_inaccuracy
.It is recommended use Numpy version >= 1.17.x to enable functions dispatch by default. If it's not the case, it is recommended import fxpmath before numpy or set OS envirnment variable "NUMPY_EXPERIMENTAL_ARRAY_FUNCTION" = "1" before import numpy.
Thanks to: @MaenMallah, @FredKellerman, @arnfol, @JoachimKoenigslieb, @masan4444, @NJDFan for all issues and contributions.