IRC channel logs

2024-06-26.log

back to list of logs

<fantazo>hmm, I have noticed that there is no type for 'exact' money values in guile. if I'm reading the documentation correctly, then any floating point value is represented as a double. And only integers can grow arbitrarily without losing accuracy.
<mwnaylor>In general, I you want total accuracy, stick to intergers and rationals. Only convert to floating upon display.
<mwnaylor>s/I/if/
<cpli>can you have complex rationals?
<mwnaylor>May take longer to compute, but I've grown to respect the rationals in Common Lisp, Scheme, and Clojure.
<dthompson>cpli: no the real and imaginary parts of complex numbers are floats
<cpli>Q-Q
<cpli>should it stay that way?
<cpli>i'm with mwnaylor when it comes to "stick to integers and rationals", but if that means i'll have to literally stick with open fields it makes me sad
<dthompson>open fields?
<cpli>complex numbers is *the* algebraically closed field
<dthompson>seems like "field" is a math term I just don't know
<cpli>(uhh.. if we ignore fields of characteristic n, and p-adic "fields")
<dthompson>I don't ever use complex numbers so I don't know why they use floats. presumably there's a good reason.
<cpli>yeah, hardware.
<cpli>complex multiplication is bothersome; i.e.: (a+bi)(c+di) => ac+adi+bci-bd
<dthompson>yeah it's annoying... had to implement it awhile back
<cpli>actually, we already store multiple numbers in ratios though
<cpli>and it's not as though rational multiplication doesn't involve taking gcds..
<cpli>i genuinely think there might just not be much demand for it
<cpli>dthompson here's wingo saying "they're implementable, i don't see a use" https://lists.gnu.org/r/guile-devel/2010-09/msg00136.html
<cpli>back in 2010
<dthompson>and we followed that same implementation in hoot
<dthompson> https://gitlab.com/spritely/guile-hoot/-/blob/main/module/hoot/stdlib.scm?ref_type=heads#L145
<dthompson>certainly makes implementation easier
<cpli>i'd imagine ^^
<cpli>i mean that genuinely q-q; i wouldn't be able to stop myself from loosing time to figuring out if there's some nice way to implement exact sqrts
<cpli>the answer is (theoretically) yes, but (practically) no
<mwette>many fields of engineering (e.g., electronics, control systems, optics) use complex numbers; e.g., taking the magnitue of a rational function (Laplace transform) evaluated along the imaginary axis
<rlb>apteryx: I'm planning to package 3.0.10 for debian first. But ping me in a while if I forget -- i.e. I'll look back at that cond-expand patch, and if it still seems fine, I'll probably merge it.
<mwette>rlb: Does debian use `--diable-tmpnam' arg to configure?
<mwette>s/diable/disable/
<rlb>mwette: not atm, I think? https://salsa.debian.org/rlb/deb-guile/-/blob/deb/guile-3.0/d/sid/master/debian/rules?ref_type=heads#L188-190
<cpli>mwette: and so is fourier, but calculating an exact ft is an action on a continuous space, and calculating an exact dft defeats the point of it being used for all the applications fft is used for.
<lechner>Hi, when does Guile print "guile: warning: failed to install locale", please?
<cpli>lechner: https://git.savannah.gnu.org/cgit/guile.git/tree/libguile/guile.c#n92
<cpli>lechner: https://git.savannah.gnu.org/cgit/guile.git/tree/module/ice-9/top-repl.scm#n71
<lechner>cpli / thanks! i'm using Guile via the Tortoise (C) interface. No main, and no REPL. Can either ones of those code references apply?
<lechner>Hi, does Guile offer interfaces to the getrlimit/setrlimit system calls?
<lechner>nvm, i found it. not sure it's in the manual