IRC channel logs

2014-11-05.log

back to list of logs

<lloda>hello mark_weaver
<lloda>is this a bug?
<lloda>(= (mod -3.1390816482077676e-16 6.283185307179586) 6.283185307179586)
<lloda>$18 = #t
<lloda>but (help mod)
<lloda>Return the real number R such that 0 <= R < abs(Y) and X = Q*Y + R
<mark_weaver>lloda: I think the answer is correct.
<mark_weaver>conceptually, the answer is less than the divisor, but the difference is lost by the inexact representation.
<mark_weaver>lloda: does that make sense?
<mark_weaver>maybe the docs should be clarified
<mark_weaver>I think that returning 0.0 would be worse here, IMO.
<lloda>I think returning 0.0 would be better, because then you can rely on < .
<mark_weaver>but then the difference between X and R is not a multiple of the divisor.
<lloda>I see that :-/
<mark_weaver>inexact arithmetic is .... messy
<lloda>context is like this:
<lloda>there's a dft vector, say [f0 f1 f2 f3]
<lloda>so f0 corresponds to w=0, f1 to 2*pi*1/4, f2 to 2*pi*2/4, and f3 to 2*pi*3/4
<lloda>if I want to interpolate in this vector, I take w mod 2pi, and I can interpolate in this table: w: [0 1 2 3 4] * 2*pi/4, f: [f0 f1 f2 f3 f0]
<lloda>so I need only one sentinel at the end.
<lloda>but If w mod 2pi can give 2pi, then I need TWO sentinels.
<lloda>no big deal really, just annoying.
<mark_weaver>the thing is, mod corresponds to the remainder part of 'floor/', so there are multiple constraints here that must be kept consistent.
<mark_weaver>the quotient result of 'floor/' is defined to be floor(x/y)
<mark_weaver>and of course the remainder must be kept consistent with the quotient to maintain Y = Q*Y + R
<mark_weaver>floor(-3.13e-16 / 6.2831) must obviously be -1, not 0.
<mark_weaver>but yeah, I can see why it's annoying in this case.
<mark_weaver>sorry, 'mod' actually corresponds to the remainder result of 'euclidean/', but euclidean/ is the same as floor/ when the divisor is positive.
<lloda>the docs explain it well, but maybe there should be a footnote that R may not always be < abs(Y)
<lloda>I'll deal with it. Thanks.
<mark_weaver>np!
<mark_weaver>I'll poke at the docs
<nalaginrut>morning guilers~
<civodul>Hello Guilers!
<nalaginrut>heya
<Chaos`Eternal>is there any solutions to file alteration monitor in guile?
<civodul>Chaos`Eternal: i haven't tried, but https://github.com/b4283/guile-inotify should work
<Chaos`Eternal>civodul, thanks a lot
<Chaos`Eternal>reading the code
<lloda`>I'd really like to make lbnd!=0 in arrays deprecated, it's a pain to support, and there's no real use for it. 2.11 already introduces some incompatible changes to arrays so I think this would be the ideal time.
<lloda`> I can put together an case for the ML, but first I'd like to know what you guys think.
<taylanub>lloda`: with 2.11 did you mean 2.1 i.e. upcoming 2.2 ?
<lloda`>yes
<taylanub>ok
<lloda`>s/2.11/2.1
<lloda`>/
<dsmith-work>Morning Greetings, Guilers
<stis>heya guilers!
<paroneayea>taylanub: just saw https://gitorious.org/taylan-scheme/srfi on the scheme subreddit
<paroneayea>very cool :)
<taylanub>thanks :) ignoring the lack of test-suites, current progress is almost 50%, from SRFIs that seem implementable; and a couple of those aren't in Guile. mind you though I'm just reusing reference implementations most of the time
<dsmith-work>Hey hey