Fxpmath

Latest version: v0.4.9

Safety actively analyzes 629765 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

0.4.3

* Fxp adds `config` as optional init parameter (kwarg).
* Functions (operators) over one and two variables copy first operator configuration by default.
* Changes above fixed wrap overflowing bug after operation (issue 42 solved).
* Wrap function of utils fix bug when data has more than n_word_max (64 bits in the most of cases) (issue 41 soved).
* Config new methods: copy, deepcopy.
* Fix warning about internal complex check (issue 39).
* Add link implementation between `functions.truediv` with `numpy.divide`.
* Add `axes` parameter to `transpose` method.

0.4.2

* Add template to Config object.
* Fix config update from Fxp's template.

0.4.1

changelog

* Test Numpy precision at init.
* Independent definition of n_word_max and error for config.
* Fix astype casting when dtype and vdtype is None.
* Fix casting to object in extended cumprod function.
* Independent definition of n_word_max and error for config.
* Fix astype casting when dtype and vdtype is None.
* Fix casting to object in extended cumprod function.
* Fix casting to object in extended precision multiply.
* Fix casting to object inside constructor.
* fix integer repr
* support numpy array of strings

Issues fixed: 26, 31

0.4.0

changelog

* Extended precision (beyond 64 bits) in `add`, `sub`, `mult`, `truediv`, `floordiv`, `mod` and `pow` functions and methods (operators).
* Support new input formats for values: `tuples`, `Decimal` type from `decimal` module.
* dtype can be specified at init if `fxp` format or `Q` format (it replaces explicit sizing by signed, n_word, and n_frac parameters).
* Template functionality added. It allows define default format for new Fxp objects.
* Config class created to manage low level configuration of Fxp object's behavior.
- size limits: `max_error`, `n_word_max`. Parameters to define n_word and n_frac of a new Fxp.
- behavior: `op_method` (defines calculation method for ALU operators).
- inputs: `op_input_size` (defines sizing of constant conversion to Fxp in math operations).
- alu ops outpus: `op_out`, `op_out_like`, `op_sizing` (define the sizing method or type for results of ALU operations).
- alu ops with a constant operand: `const_op_sizing` (alternative of `op_sizing` when one of ALU operands is a constant).
- array ops: `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).
* Several core calculations/methods mirgrated from `float` to `int` to support extended precision.
* Extended precision flag in status (extended_prec).
* Results of ALU operations with constants keep same size than Fxp object (by default).
* `like` initialization supports overwrite of size parameters.
* Numpy functions dispatch. You can use Fxp as arguments (inputs) of Numpy functions and get Fxp as outputs of them.
* New Fxp properties: size, shape, ndim, T.
* New Fxp methods: reshape, flatten, raw, uraw.
* New Fxp methods from Numpy array methods: all, any, argmax, argmin, argpartition, argsort, max, min, mean, std, var, sum, cumsum, cumprod,
ravel, tolist, sort, conjugate, conj, transpose, item, clip, diagonal, trace, prod, dot, nonzero.
* Support for `bool`, `int`, `float` and `complex` casting.
* dtype included in Fxp's representation (__repr__).
* Callbacks (basic) functionality added: `on_value_change`, `on_status_overflow`, `on_status_underflow`, `on_status_inaccuracy`.
* Some performance improvements.

Notes:

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.

0.3.9

* fix wrapping (issue 20, thanks to MaenMallah).

0.3.8

---
* hex representations support padding.
* fix bug with 'b' in hex string (issue 15).
* fix inaccuracy word in status (issue 16).
* fix `__pow__` method (issue 17).
* fix bug that only store imaginary part in complex assignement by indexing (issue 19).

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.