IRC channel logs
2014-11-05.log
back to list of logs
<lloda>(= (mod -3.1390816482077676e-16 6.283185307179586) 6.283185307179586) <lloda>Return the real number R such that 0 <= R < abs(Y) and X = Q*Y + R <mark_weaver>conceptually, the answer is less than the divisor, but the difference is lost by the inexact representation. <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>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>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'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 ? <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