Re: Returning double results in pil21 ?

2021-09-29 Thread Alexander Burger
Hi Andras, > My post is indicated by Mia’s blog entry ;) since I have cross-checked the > results > between pil21 and my 64bit pil32 fork. Ah, nice! :) Anyway this double to pil number conversion was not the problem here. > pil32 flawlessly converted double results to bignums, but I

Re: Returning double results in pil21 ?

2021-09-29 Thread Andras Pahi
Hi Alex, My post is indicated by Mia’s blog entry ;) since I have cross-checked the results between pil21 and my 64bit pil32 fork. pil32 flawlessly converted double results to bignums, but I understand the efficiency consideration. Thanks, Andras Pahi > On 2021. Sep 29., at 16:37,

Re: Returning double results in pil21 ?

2021-09-29 Thread Alexander Burger
On Wed, Sep 29, 2021 at 04:28:20PM +0200, Alexander Burger wrote: > BTW, pil64 did the same. Side note: Mia's blog from today has an interesting case of floating point versus fixpoint. PicoLisp fixpoint arithmetics turns out to be superior:

Re: Returning double results in pil21 ?

2021-09-29 Thread Andras Pahi
Hi Alex, I understand that the result will be correct for 56bits only (as for every double FP number), but we lose the dynamic range. So pil21 will only return 60bits worth of doubles ;) Thanks, Andras Pahi > On 2021. Sep 29., at 16:16, Alexander Burger wrote: > > Ah, yes, that's correct.

Re: Returning double results in pil21 ?

2021-09-29 Thread Alexander Burger
On Wed, Sep 29, 2021 at 04:16:32PM +0200, Alexander Burger wrote: > Ah, yes, that's correct. This is because even a double has only 56 bits of > precision, so the 60 bits of a short number should be enough. BTW, pil64 did the same. You *could* build also bignums of course, but where to stop? It

Re: Returning double results in pil21 ?

2021-09-29 Thread Alexander Burger
On Wed, Sep 29, 2021 at 04:05:21PM +0200, Andras Pahi wrote: > I mean that in pil21 src/lib.c boxFloat() and boxDouble() restricts the range > of float/doubles to short numbers only… Ah, yes, that's correct. This is because even a double has only 56 bits of precision, so the 60 bits of a short

Re: Returning double results in pil21 ?

2021-09-29 Thread Andras Pahi
Hi Alex, Thanks. I mean that in pil21 src/lib.c boxFloat() and boxDouble() restricts the range of float/doubles to short numbers only… Thanks, Andras Pahi > On 2021. Sep 29., at 15:41, Alexander Burger wrote: > > Hi Andras, > >> As I see, the native function with the scaled fixpoint

Re: Returning double results in pil21 ?

2021-09-29 Thread Alexander Burger
Hi Andras, > As I see, the native function with the scaled fixpoint specification can > return only a short number ? > Is it a bug or a feature ? It can also return a 'double'. A single precision 'float' number is returned via the -1.0 spec, and a 'double' is returned via the +1.0 spec. ☺/

Returning double results in pil21 ?

2021-09-29 Thread Andras Pahi
Hi, As I see, the native function with the scaled fixpoint specification can return only a short number ? Is it a bug or a feature ? Thanks, Andras Pahi -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe