[Numpy-discussion] ANN: APyTypes 0.1

2024-05-15 Thread Oscar Gustafsson
should be noted that this is not a suitable replacement if you just want to use a different, existing, dtype, e.g. from ml_dtypes, this is a completely flexible solution for any dtype with complete control of rounding/quantization, including stochastic quantization. BR Oscar Gustafsson (I will not

[Numpy-discussion] Re: How is "round to N decimal places" defined for binary floating point numbers?

2023-12-29 Thread Oscar Gustafsson
er. (Didn't read it before starting writing this.) Quite a lot of interesting discussions, especially the legacy argument. BR Oscar Gustafsson (FWIW, I suggested that NumPy should be able to round to a given number of bits, or arbitrary base, primarily as a way to fake (short) fixed-point repr

[Numpy-discussion] Re: New feature: binary (arbitrary base) rounding

2022-11-11 Thread Oscar Gustafsson
the spring, so primarily asking for planning and describing the project a bit better. BR Oscar Den tors 10 nov. 2022 kl 15:13 skrev Sebastian Berg < sebast...@sipsolutions.net>: > On Thu, 2022-11-10 at 14:55 +0100, Oscar Gustafsson wrote: > > Den tors 10 nov. 2022 kl 13:10 skrev Se

[Numpy-discussion] Re: New feature: binary (arbitrary base) rounding

2022-11-10 Thread Oscar Gustafsson
Den tors 10 nov. 2022 kl 13:10 skrev Sebastian Berg < sebast...@sipsolutions.net>: > On Thu, 2022-11-10 at 11:08 +0100, Oscar Gustafsson wrote: > > > > > > I'm not an expert, but I never encountered rounding floating point > > > numbers > > >

[Numpy-discussion] Re: New feature: binary (arbitrary base) rounding

2022-11-10 Thread Oscar Gustafsson
he quant function, https://www.mathworks.com/help/deeplearning/ref/quant.html which basically supports arbitrary bases (as a special case of an even more general approach). So there may be other use cases (although the example basically just implements around(x, 1)). BR

[Numpy-discussion] Re: New feature: binary (arbitrary base) rounding

2022-11-10 Thread Oscar Gustafsson
Den tis 8 nov. 2022 kl 11:44 skrev Sebastian Berg < sebast...@sipsolutions.net>: > On Thu, 2022-11-03 at 11:37 +0100, Oscar Gustafsson wrote: > > Hi all, > > > > I hope this is the correct way to propose a new feature. > > https://github.com/numpy/numpy/is

[Numpy-discussion] New feature: binary (arbitrary base) rounding

2022-11-03 Thread Oscar Gustafsson
. Provide a separate function (binaryround?) 2. Provide a base argument to around which defaults to 10. 3. Provide a quant(ization) function where the argument is the step-size. (For completeness, one may think of having multiple quantization modes, not just rounding) Any opinions? BR Oscar Gustafsson