Re: [Rd] Modification-proposal for %% (modulo) when supplied with double

2018-09-11 Thread frederik
Duncan, I think Emil realizes that the floating point format isn't able to represent certain numbers, that's why he is suggesting this change rather than complaining about our arithmetic being broken. However, I agree with you that we should not adopt his proposal. It would not make things more "u

[Rd] var() with 0-length vector -- docs inconsistent with result

2018-09-11 Thread Raubertas, Richard via R-devel
R 3.5.1 on Windows 7 The documentation for 'var' says: "These functions return 'NA' when there is only one observation (whereas S-PLUS has been returning 'NaN'), and fail if 'x' has length zero." The function 'sd' (based on 'var') has similar documentation. However, I get: var(numeric(0)) [

Re: [Rd] Modification-proposal for %% (modulo) when supplied with double

2018-09-11 Thread Duncan Murdoch
On 11/09/2018 11:23 AM, Emil Bode wrote: Hi all, Could we modify the "%%" (modulo)-operator to include some tolerance for rounding-errors when supplied with doubles? It's not much work (patch supplied on the bottom), and I don't think it would break anything, only if you were really interes

[Rd] Modification-proposal for %% (modulo) when supplied with double

2018-09-11 Thread Emil Bode
Hi all, Could we modify the "%%" (modulo)-operator to include some tolerance for rounding-errors when supplied with doubles? It's not much work (patch supplied on the bottom), and I don't think it would break anything, only if you were really interested in analysing rounding differences. An