Ah, I see.

I also found the issue was brought up previously:
https://www.mail-archive.com/picolisp@software-lab.de/msg10799.html

I agree with keeping the spec small (in regards to the most recent
discussion), but possibly another token to identify bignum returns?

-Kevin

On Thu, Dec 9, 2021 at 1:29 PM Alexander Burger <a...@software-lab.de> wrote:

> Hi Kevin,
>
> > found some of the intermediate
> > values (the determinate) were smaller than 1e6 (my scl is 6) and so my
> > thought is to increase the scale to increase the precision.
>
> The problem are not the small numbers, but the larger ones.
>
> I think it is a design flaw in the float/double interface in PicoLisp, as
> it
> uses short numbers to pass floats and doubles to and from native.
>
> If you have scale 16 and parse 123.0, you get 61 bits:
>
>    : (scl 16)
>    -> 16
>    : (length (bin 123.0))
>    -> 61
>
> but a short num can be maximally 60 bits.
>
> A *small* number is no problem:
>
>    : (length (bin 0.000123))
>    -> 41
>
> The conversion functions in @src/lib.c (mentioned in my previous mail)
> should
> indeed overflow to bignums. In fact, pil32 did it this way (it had no
> short nums
> but only bignums).
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>

Reply via email to