Re: [R] Annoyance with %/%

2015-03-12 Thread William Dunlap
> %/% which, BTW, > violated the sacred rule that for all a, and non-zero b: > > a = b * (a %/% b) + a %% b > > Namely, that Inf %/% n is not Inf, but NaN. But the other sacred rule is that a%%b is >=0 and (1 + 2^53) %% 2 # 1 if you had infinite precision [1] 0 > (2 + 2^53) %% 2 [1] 0 War

Re: [R] Annoyance with %/%

2015-03-11 Thread ALBERTO VIEIRA FERREIRA MONTEIRO
> shouldn't your last expression be: > > if (any(tst)) big.vector.1[tst] <- big.vector.2[tst] > > Sure, that was a typo. Also, I know that `%%` does not make sense neither for Inf nor for big numbers, but `%/%` - since it's "only" a special case of `/` - should make sense; it should be "equivalent

Re: [R] Annoyance with %/%

2015-03-11 Thread jim holtman
shouldn't your last expression be: if (any(tst)) big.vector.1[tst] <- big.vector.2[tst] Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Mar 11, 2015 at 11:14 AM, William Dunlap wrote: > > %/% which

[R] Annoyance with %/%

2015-03-11 Thread ALBERTO VIEIRA FERREIRA MONTEIRO
I've just found an annoyance with the behaviour of %/% which, BTW, violated the sacred rule that for all a, and non-zero b: a = b * (a %/% b) + a %% b Namely, that Inf %/% n is not Inf, but NaN. Why is this so? It's an annoyance, because in expressions like: big.vector.1[a, b, c] <- big.vector.