soweli_iki has quit [Remote host closed the connection]
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
JuanDaugherty has joined #commonlisp
brokkoli_origin has quit [Ping timeout: 245 seconds]
thuna` has quit [Ping timeout: 248 seconds]
tstearns has joined #commonlisp
brokkoli_origin has joined #commonlisp
josrr has quit [Remote host closed the connection]
markb1 has quit [Ping timeout: 244 seconds]
surabax has quit [Quit: Leaving]
X-Scale has quit [Ping timeout: 272 seconds]
markb1 has joined #commonlisp
Perflosopher03 has joined #commonlisp
JuanDaugherty has quit [Quit: praxis.meansofproduction.biz (juan@acm.org)]
chkhd has quit [Ping timeout: 244 seconds]
random-nick has quit [Ping timeout: 252 seconds]
lutherann has joined #commonlisp
awlygj has quit [Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in]
awlygj has joined #commonlisp
stanrifkin has joined #commonlisp
stanrifkin_ has quit [Ping timeout: 252 seconds]
Eoco has quit [Quit: WeeChat 4.4.2]
Eoco has joined #commonlisp
zwr has quit [Read error: Connection reset by peer]
Eoco has quit [Quit: WeeChat 4.4.2]
Eoco has joined #commonlisp
zwr has joined #commonlisp
decweb has quit [Quit: Konversation terminated!]
foretspa1sibles has quit [Ping timeout: 244 seconds]
foretspa1sibles has joined #commonlisp
remexre has quit [Ping timeout: 268 seconds]
Eoco has quit [Ping timeout: 272 seconds]
Eoco has joined #commonlisp
remexre has joined #commonlisp
markb1 has quit [Ping timeout: 244 seconds]
markb1 has joined #commonlisp
mulk has quit [Ping timeout: 244 seconds]
mulk has joined #commonlisp
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
markb1 has quit [Ping timeout: 252 seconds]
markb1 has joined #commonlisp
markb1 has quit [Ping timeout: 272 seconds]
soweli_iki has joined #commonlisp
markb1 has joined #commonlisp
pranav has quit [Remote host closed the connection]
pranav has joined #commonlisp
Guest47 has joined #commonlisp
waleee has quit [Ping timeout: 276 seconds]
istewart has quit [Quit: Konversation terminated!]
bpanthi977 has quit [Ping timeout: 248 seconds]
markb1 has quit [Ping timeout: 244 seconds]
edgar-rft has joined #commonlisp
edgar-rft` has quit [Ping timeout: 248 seconds]
markb1 has joined #commonlisp
Pixel_Outlaw has quit [Remote host closed the connection]
ebrasca has joined #commonlisp
cmack` has joined #commonlisp
cmack has quit [Ping timeout: 276 seconds]
veqq has quit [Ping timeout: 244 seconds]
oneeyedalien has joined #commonlisp
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 268 seconds]
Lord_of_Life_ is now known as Lord_of_Life
oneeyedalien has quit [Remote host closed the connection]
shka has joined #commonlisp
zwr has quit [Ping timeout: 252 seconds]
zwr has joined #commonlisp
khinsen has joined #commonlisp
anonpreet has joined #commonlisp
<khinsen>
> Where is repo?
<khinsen>
The top level (i.e. the demo server) is at https://codeberg.org/khinsen/hyperdoc-demo. All the dependencies written by myself are on codeberg.org as well. And all the other dependencies are what I consider "well-known".
<ixelp>
hyperdoc-demo
anonpreet has quit [Remote host closed the connection]
mishoo has joined #commonlisp
<khinsen>
I really wish Quicklisp would include repo URLs in its package descriptions!
markb1 has quit [Ping timeout: 272 seconds]
<nil>
khinsen: ASDF systems already have Homepage and Bug-tracker fields for URLs.
<khinsen>
> khinsen: ASDF systems already have Homepage and Bug-tracker fields for URLs.
<khinsen>
Indeed, but who looks as ASDF system definitions? OK, I do, but I mean, who else? ;-)
<khinsen>
BTW, if you load my HyperDoc system (or just the underlying inspector) in your local image, you can do `(clog-moldable-inspector:clog-inspect :object html-inspector-views/standard:*image*)` to browse the loaded and available-but-unloaded ASDF systems.
<beach>
Why does (FLOOR MOST-POSITIVE-DOUBLE-FLOAT 3) signal a FLOATING-POINT-OVERFLOW in SBCL? I mean, is there a fundamental reason for that to happen, or is it just the way SBCL implements it?
alcor has joined #commonlisp
cage has joined #commonlisp
<alcor>
This question is probably asked a lot, but what's the de-facto standard "generic hash table" library? I need something that allows specifying a custom hasher (which is unfortunately one glaring omission in standard CL).
<JoshYoshi>
On 2.4.5 I get an output
<JoshYoshi>
a condition isn't signalled
<beach>
JoshYoshi: Oh, thanks! Good to know.
<beach>
Hmm, I have 2.4.8.
<beach>
So I think that means that there is no fundamental reason for an error to be signaled, *and* this issue was introduced somewhere between 2.4.5 and 2.4.8.
<|3b|>
yeah, pretty suspicious it seems to be specific to 3 also
<|3b|>
and maybe the double before 3
<beach>
I get the same thing with 7 substituted for 3.
<beach>
And 9.
* |3b|
meant more that 2.999999 and 3.0000001 and similar are OK
<beach>
I see.
<|3b|>
so there are bad numbers, but it isn't just "it breaks at 2" or something obvious like that which could plausibly be a real limit
<beach>
Right.
zwr has joined #commonlisp
cage has quit [Read error: Connection reset by peer]
X-Scale has joined #commonlisp
cage has joined #commonlisp
markb1 has quit [Ping timeout: 260 seconds]
fart_cat has joined #commonlisp
fat_groot has quit [Ping timeout: 248 seconds]
bpanthi977 has joined #commonlisp
bpanthi977 has quit [Ping timeout: 252 seconds]
markb1 has joined #commonlisp
chkhd_ has joined #commonlisp
zwr has quit [Remote host closed the connection]
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
treflip has joined #commonlisp
cage has quit [Remote host closed the connection]
cage has joined #commonlisp
treflip` has joined #commonlisp
treflip has quit [Ping timeout: 246 seconds]
treflip` has quit [Remote host closed the connection]
srji has joined #commonlisp
<srji>
hello
<srji>
o/
treflip has joined #commonlisp
treflip` has joined #commonlisp
bpanthi977 has joined #commonlisp
bpanthi977 has quit [Ping timeout: 248 seconds]
treflip has quit [Remote host closed the connection]
treflip` has quit [Remote host closed the connection]
chkhd_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<beach>
Hello srji.
<JoshYoshi>
I should have mentioned that I have safety 3
<beach>
I do too.
dra has joined #commonlisp
dra has quit [Changing host]
dra has joined #commonlisp
McParen has joined #commonlisp
markb1 has quit [Ping timeout: 244 seconds]
ixelp has quit [Ping timeout: 244 seconds]
ixelp has joined #commonlisp
markb1 has joined #commonlisp
<semz>
Interestingly it says the offending operation was (* 5.992310449541053d307 3.0d0) even though MOST-POSITIVE-DOUBLE-FLOAT is 1.7976931348623157d308
* semz
suspects there is some (x/3)*3 involved that chokes on rounding error near the edges
<beach>
Yeah, something like that.
pranav has quit [Read error: Connection reset by peer]
pranav has joined #commonlisp
decweb has joined #commonlisp
bpanthi977 has joined #commonlisp
luna-is-here has joined #commonlisp
shawnw has quit [Ping timeout: 252 seconds]
bpanthi977 has quit [Ping timeout: 276 seconds]
msv has quit [Remote host closed the connection]
msv has joined #commonlisp
msv has quit [Remote host closed the connection]
msv has joined #commonlisp
markb1 has quit [Ping timeout: 246 seconds]
markb1 has joined #commonlisp
kevingal has joined #commonlisp
srji has quit [Ping timeout: 260 seconds]
treflip has joined #commonlisp
random-jellyfish has quit [Ping timeout: 252 seconds]
markb1 has quit [Ping timeout: 248 seconds]
pranav has quit [Remote host closed the connection]
<semz>
Oh, it's for the second return value.
<beach>
Yes, I see.
random-nick has joined #commonlisp
Guest47 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
treflip` has joined #commonlisp
treflip has quit [Ping timeout: 245 seconds]
srji has joined #commonlisp
Guest47 has joined #commonlisp
markb1 has joined #commonlisp
ym has joined #commonlisp
JuanDaugherty has joined #commonlisp
treflip`` has joined #commonlisp
puke has quit [Ping timeout: 252 seconds]
treflip` has quit [Ping timeout: 268 seconds]
pve has joined #commonlisp
markb1 has quit [Ping timeout: 244 seconds]
puke has joined #commonlisp
pranav has joined #commonlisp
markb1 has joined #commonlisp
treflip`` has quit [Ping timeout: 252 seconds]
Guest47 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
markb1 has quit [Ping timeout: 248 seconds]
<semz>
It's a good question whether this is a bug. The spec says FLOOR's quotient must "[represent] the largest mathematical integer that is not larger than the mathematical quotient", and 5.992310449541053d307 is indeed the representation of said integer as a double float, even though the actual number behind this float is larger: ,(minusp (- (rationalize most-positive-double-float) (* 3 (rationalize 5.992310449541053d307))))
<beach>
I don't know what the "actual number" is and how it is different from the "said integer"? Also, I wouldn't bet on the decimal-to-float conversion being accurate.
<semz>
RATIONAL would be more appropriate than RATIONALIZE, but it makes no difference here. Force of habit.
<semz>
CCL's is accurate in this case, I checked the underlying uvector.
<beach>
And "said integer"?
<semz>
the largest integer that is not larger than the mathematical quotient
shawnw has joined #commonlisp
<beach>
I am not sure I follow. I think I would have to figure this out myself to be convinced.
<gilberth>
Are we still talking about the two argument case (TRUNCATE MOST-POSITIVE-DOUBLE-FLOAT 3)?
<beach>
Yes.
<semz>
yes
markb1 has joined #commonlisp
<gilberth>
That's funny for my CCL also gets a floating point trap while trying to compute (* 3d0 (/ MOST-POSITIVE-DOUBLE-FLOAT 3d0)) for the remainder.
<gilberth>
Which isn't a remainder but an error rather. I find that a bit confusing.
<semz>
That operation does overflow ftr
<beach>
I suppose that could happen.
<semz>
the result of the division is rounded up, and then the multiplication overflows
<beach>
As I understand it, (/ MOST-POSITIVE-DOUBLE-FLOAT 3d0) is probably not exact, and could be slightly larger than the exact value.
* gilberth
checks sources again.
<beach>
So then, multiplying with 3d0 would overflow.
<semz>
indeed
<gilberth>
Indeed, it's the usual FP division performed.
JuanDaugherty has quit [Quit: praxis.meansofproduction.biz (juan@acm.org)]
<gilberth>
Sigh.
<beach>
I guess there is some rounding mode that would have to be set.
<semz>
my thought too
<gilberth>
Well, the code says (%unary-truncate (%short-float/-2! number divisor f2)).
<gilberth>
Truncating after dividing with possible rounding within the mantissa doesn't sound correct, does it?
SAL9000 has quit [Quit: WeeChat 4.4.3]
markb1 has quit [Ping timeout: 268 seconds]
<gilberth>
It is correct. Spec says: "(function number divisor) and (function (/ number divisor)) [...] return the same first value"
<semz>
that's a note though, and the examples don't involve FP
* semz
suspects this entire issue is either an oversight or some artifact of predating IEEE754
<gilberth>
MOST-POSITIVE-DOUBLE-FLOAT is a FP number.
<semz>
the examples in that note
<gilberth>
Yes, but I would still guess that this sentence applies.
<semz>
Does IEEE754 even provide CL-style floored division without editing rounding modes?
tedwing has joined #commonlisp
<gilberth>
No idea. I'm a floating noob.
<beach>
I am not very good with IEEE754 either, but it's a fascinating topic we have here.
bpanthi977 has joined #commonlisp
McParen has left #commonlisp [#commonlisp]
<beach>
Maybe the Common Lisp implementation needs to recognize (* x (/ MOST-POSITIVE-DOUBLE-FLOAT x)) as a special case.
Guest47 has joined #commonlisp
<gilberth>
Well, I would still like to believe that note saying that (= (truncate x y) (truncate (/ x y))) essentially. And multiplying what you got by the divisor and subtracting is the most obvious implementation for coming up with the second return value. It's only that it might overflow.
chkhd has joined #commonlisp
bpanthi977 has quit [Ping timeout: 260 seconds]
markb1 has joined #commonlisp
<gilberth>
Aha! When I say (#_fesetround #_FE_DOWNWARD) a (TRUNCATE MOST-POSITIVE-DOUBLE-FLOAT 3) survives. The reminder I get is 1.99584030953472D+292.
<gilberth>
No idea if that would be correct.
<beach>
I would be worried about it.
<gilberth>
As I said, I'm a floating noob. I better not touch any floating point code.
markb1 has quit [Ping timeout: 244 seconds]
wacki has joined #commonlisp
cage has quit [Remote host closed the connection]
<gilberth>
So do we know what is the correct second value? CMUCL says -1.99584030953472d292, while CLISP, ABCL, and Allegro say 0.0d0.
markb1 has joined #commonlisp
NotThatRPG_ has joined #commonlisp
<reb>
When done using integer arithmetic, the second value is 2.
NotThatRPG has quit [Ping timeout: 248 seconds]
<semz>
preserving quotient*divisor + remainder = number is probably more useful in general
<gilberth>
reb: Sure but you get a different first return value using integer arithmetic.
<gilberth>
When I compute the remainder (error) using rational numbers like ,(defun my-truncate (x y) (let ((q (truncate (/ x y)))) (values q (- (rational x) (* y q))))) I get ,(nth-value 1 (my-truncate most-positive-double-float 3))
<gilberth>
Which as a double float gives me -9.9792015476736D+291.
chkhd has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cracauer has quit [Ping timeout: 245 seconds]
cracauer has joined #commonlisp
NotThatRPG_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yitzi has joined #commonlisp
markb1 has quit [Ping timeout: 244 seconds]
markb1 has joined #commonlisp
shawnw has quit [Ping timeout: 245 seconds]
zwr has quit [Remote host closed the connection]
srji has joined #commonlisp
markb1 has quit [Ping timeout: 245 seconds]
<cdegroot>
Note that floats have maybe 17 digits precision, so when you go in these areas, things get odd. That number should be -9979201547673599058281860000000000000..... probably (haven't really followed what this is about, but if you're interested in lots of digits of precision with very large numbers, floats arent it)
<cdegroot>
(my usual take is "if you're running in these FP edge cases, you probably are using FP where you shouldn't")
<beach>
cdegroot: It is hard to avoid using floating-point if you are testing the result of TRUNCATE on a floating-point number.
jon_atack has quit [Ping timeout: 246 seconds]
<beach>
cdegroot: I recommend you read up on the discussion. It is actually pretty interesting.
pranav has quit [Read error: Connection reset by peer]
jonatack has joined #commonlisp
<cdegroot>
Is it? Truncat has an intermediate step that multplies, apparently (haven't looked at the SBCL source code), that one gets just out of bounds, and that's exactly what you expect when "living on the edge" with floats.
SAL9000 has joined #commonlisp
markb1 has joined #commonlisp
pranav has joined #commonlisp
<gilberth>
That's an implementation detail. I think it is not unreasonable to expect no floating point trap being raised given that the remainder can be represented as a double float.
<cdegroot>
I guess our definitions of "interesting" are different :-). If you look at numbers.lisp in sbcl, smells like not a super trivial operation and it does need multiplication, it seems. I guess spot the bug and fix it, but I'd be hard-pressed to think of an actual real world case where this makes a difference (and that's my personal definition of "interestiong", usually, especially when it is around floating point edge cases, which it has more than
<cdegroot>
regular cases to begin with :-))
chrcav has quit [Ping timeout: 246 seconds]
NotThatRPG has joined #commonlisp
mosin has joined #commonlisp
<cdegroot>
(also note that for numbers > 10e20, TRUNCATE with doubles is a no-op because you are effectively working with integer numbers anyway)
<cdegroot>
(so maybe that's a useful optimization :-))
NotThatRPG has quit [Client Quit]
khinsen has joined #commonlisp
<gilberth>
How? The expectation is that the remainder is an error actually. So that (multiple-value-bind (q r) (truncate x d) (= (+ (* d q) r) x)). You don't come up with that easily using integer arithmetic, in combination with (= (truncate x y) (truncate (/ x y))).
owen has quit [Ping timeout: 265 seconds]
garlic0x1 has quit [Read error: Connection reset by peer]
srji has quit [Ping timeout: 248 seconds]
bpanthi977 has joined #commonlisp
<gilberth>
Anyhow, one way to implement it could be to scale the floats and scale the remainder back. Like ,(defun struncate (x y &aux (s (nth-value 1 (decode-float x)))) (multiple-value-bind (q r) (truncate (scale-float x (- s)) (scale-float y (- s))) (values q (scale-float r s)))) ,(struncate most-positive-double-float 3d0)
<ixelp>
(defun struncate (x y &aux (s (nth-value 1 (de[...]) => STRUNCATE, and then (struncate m[...]) => 59923104495410526931242990468434471693311377570012608978724592993481656097588250315549672659195735698776762138897629303648851849283980134210219162890501940227302967333569461225424618281939237177254825243423356618523788986540947638273286944978825097573024722814788503568114237186566502697680960059301391499264; -1.99584030953472D+292
shawnw has joined #commonlisp
<gilberth>
Which is the answer that CMUCL gives. I wonder why this was changed in SBCL.
<wbooze>
32bit vs 64bit ?
<gilberth>
My guess rather is that somebody felt smart.
X-Scale has quit [Ping timeout: 272 seconds]
mosin has quit [Remote host closed the connection]