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

2023-12-29 Thread Stefano Miccoli via NumPy-Discussion
Oscar Gustafsson wrote: > I would take it that round x to N radix-R digits means > round_to_integer(x * R**N)/R**N > (ignoring floating-point issues) Yes, this is the tried-and-true way: first define the function in exact arithmetic, then ask for the floating point implementation to return an ap

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

2023-12-29 Thread Oscar Gustafsson
(Not a NumPy-dev, but here goes. Probably some of the discussions are "too basic", but hard to say which.) I would take it that round x to N radix-R digits means round_to_integer(x * R**N)/R**N (ignoring floating-point issues) Now, we can discuss what round to integer means. There, the major diff