Re: [Chicken-users] Numbers weirdness

2016-04-01 Thread John Cowan
Andy Bennett scripsit: > I'm mostly using log2 to work out if numbers are a power of two and find > the highest bit that they have set. You can use integer-length to tell how many bits are required. If you subtract 1 and the number of bits shrinks by 1, you have a power of 2. Rules for WWI

Re: [Chicken-users] CHICKEN hang / crash / memoize egg

2016-04-01 Thread Peter Bex
On Fri, Apr 01, 2016 at 03:28:26PM +0100, Andy Bennett wrote: > Hi Peeps! > > I'm running CHICKEN 4.9.0rc1 and I'm trying out the memoize egg. > > I saw the tail-call-optimized version of the factorial procedure in the > memoize documentation at http://api.call-cc.org/doc/memoize and I've > been

Re: [Chicken-users] CHICKEN hang / crash / memoize egg

2016-04-01 Thread Arthur Maciel
Dear Andy, good to know you are playing with the memoize egg. ATM I don't have time to look deeper into the problem you pointed out. Sorry for that. After I finish some personal stuff I'll dig into it. Cheers, Arthur Em 01/04/2016 11:56, "Andy Bennett" escreveu: > On

Re: [Chicken-users] Numbers weirdness

2016-04-01 Thread Peter Bex
On Fri, Apr 01, 2016 at 06:23:28PM +0100, Andy Bennett wrote: > Thanks Peter! > > I'm mostly using log2 to work out if numbers are a power of two and find > the highest bit that they have set. > > Is there a more robust way to do that in CHICKEN when using the numbers > egg and bignums? It's

Re: [Chicken-users] Numbers weirdness

2016-04-01 Thread John Cowan
Peter Bex scripsit: > That's a complete mischaracterisation. First, it depends on your > definition of "accurately", and secondly, you can tell CHICKEN to > change the print precision. See my other mail, which shows that > Racket is _also_ truncating the value, just after more digits than >

Re: [Chicken-users] Numbers weirdness

2016-04-01 Thread Andy Bennett
Hi, >> Is it just late on a Friday? Am I crazy? > > Floating point numbers are weird enough to drive anyone bat shit: > > #;1> (use numbers) > #;2> (define (log2 n) (/ (log n) (log 2))) > #;3> (log2 (expt 2 251)) > 251.0 > #;4> (flonum-print-precision 100) > 15 > #;5> (log2 (expt 2 251)) >

Re: [Chicken-users] Numbers weirdness

2016-04-01 Thread Peter Bex
On Fri, Apr 01, 2016 at 12:48:54PM -0400, John Cowan wrote: > Trying (log2 (expt 2 251)) in Racket, which prints 64-bit floats > accurately (unlike Chicken, which depends on C to do it) That's a complete mischaracterisation. First, it depends on your definition of "accurately", and secondly, you

Re: [Chicken-users] Numbers weirdness

2016-04-01 Thread Peter Bex
On Fri, Apr 01, 2016 at 05:25:44PM +0100, Andy Bennett wrote: > Hi, > > In CHICKEN 4.9.0rc1 and 4.10.0 both with numbers 4.6: > > - > #;1> (use numbers) > #;2> (define (log2 n) (/ (log n) (log 2))) > #;3> (= (log2 (expt 2 252)) (ceiling (log2 (expt 2 252 > #t > #;4> (= (log2 (expt 2

Re: [Chicken-users] Numbers weirdness

2016-04-01 Thread John Cowan
Andy Bennett scripsit: > #;5> (log2 (expt 2 251)) > 251.0 > #;6> (ceiling (log2 (expt 2 251))) > 252.0 > > Is it just late on a Friday? Am I crazy? Trying (log2 (expt 2 251)) in Racket, which prints 64-bit floats accurately (unlike Chicken, which depends on C to do it) returns a value of

[Chicken-users] Numbers weirdness

2016-04-01 Thread Andy Bennett
Hi, In CHICKEN 4.9.0rc1 and 4.10.0 both with numbers 4.6: - #;1> (use numbers) #;2> (define (log2 n) (/ (log n) (log 2))) #;3> (= (log2 (expt 2 252)) (ceiling (log2 (expt 2 252 #t #;4> (= (log2 (expt 2 251)) (ceiling (log2 (expt 2 251 #f #;5> (log2 (expt 2 251)) 251.0 #;6> (ceiling

[Chicken-users] [TFP 2016] Final call for papers

2016-04-01 Thread Peter Achten
- C A L L F O R P A P E R S - TFP 2016 === 17th Symposium on Trends in Functional Programming June

Re: [Chicken-users] CHICKEN hang / crash / memoize egg

2016-04-01 Thread Andy Bennett
On 01/04/16 15:28, Andy Bennett wrote: > Hi Peeps! > > I'm running CHICKEN 4.9.0rc1 and I'm trying out the memoize egg. > > I saw the tail-call-optimized version of the factorial procedure in the > memoize documentation at http://api.call-cc.org/doc/memoize and I've > been trying to modify it so

Re: [Chicken-users] CHICKEN hang / crash / memoize egg

2016-04-01 Thread Andy Bennett
Hi, >> I'm running CHICKEN 4.9.0rc1 and I'm trying out the memoize egg. >> >> I saw the tail-call-optimized version of the factorial procedure in the >> memoize documentation at http://api.call-cc.org/doc/memoize and I've >> been trying to modify it so that it memoizes intermediate results such

Re: [Chicken-users] CHICKEN hang / crash / memoize egg

2016-04-01 Thread Kooda
On Fri, 01 Apr 2016 16:28:26 +0200, Andy Bennett wrote: > > Hi Peeps! > > I'm running CHICKEN 4.9.0rc1 and I'm trying out the memoize egg. > > I saw the tail-call-optimized version of the factorial procedure in the > memoize documentation at http://api.call-cc.org/doc/memoize and I've > been

Re: [Chicken-users] cross compiled hellow world says: Error: call of non-procedure: #

2016-04-01 Thread Peter Bex
On Fri, Apr 01, 2016 at 01:49:35PM +, jo wrote: > Hi > > This time I followed the instructions on > http://wiki.call-cc.org/man/4/Cross%20development to build a cross compiler > for powerpc. > > After the build I copied the target tree to the device. > I compiled following test program: >