Re: Immediate doubles (up to 2^256) and rationals coming to Guile 3

2019-06-08 Thread Arne Babenhauserheide
Mark H Weaver writes: > Mark H Weaver writes: > >> Here's the format of fixrats on 64-bit systems: … > This allows for an elegant packing operation: > > if (SCM_I_INUMP (numerator) && SCM_I_INUMP (denominator)) > { > union { double f; uint64_t u; } u; > u.f = SCM_I_INUM (num

Re: Immediate doubles (up to 2^256) and rationals coming to Guile 3

2019-06-08 Thread Chris Vine
On Sat, 08 Jun 2019 10:07:45 +0200 Arne Babenhauserheide wrote: [snip] > Wow, I didn’t know that you could do that. > > However: "The details of that allocation are implementation-defined, and > it's undefined behavior to read from the member of the union that wasn't > most recently written." htt

Re: Immediate doubles (up to 2^256) and rationals coming to Guile 3

2019-06-08 Thread Arne Babenhauserheide
Chris Vine writes: > On Sat, 08 Jun 2019 10:07:45 +0200 > Arne Babenhauserheide wrote: > [snip] >> Wow, I didn’t know that you could do that. >> >> However: "The details of that allocation are implementation-defined, and >> it's undefined behavior to read from the member of the union that wasn

Re: Immediate doubles (up to 2^256) and rationals coming to Guile 3

2019-06-08 Thread Chris Vine
On Sat, 08 Jun 2019 11:46:10 +0200 Arne Babenhauserheide wrote: > Chris Vine writes: > > On Sat, 08 Jun 2019 10:07:45 +0200 > > Arne Babenhauserheide wrote: > > [snip] > >> Wow, I didn’t know that you could do that. > >> > >> However: "The details of that allocation are implementation-defined,

Re: Immediate doubles (up to 2^256) and rationals coming to Guile 3

2019-06-08 Thread Hans Åberg
> On 8 Jun 2019, at 11:08, Chris Vine wrote: > > On Sat, 08 Jun 2019 10:07:45 +0200 > Arne Babenhauserheide wrote: > [snip] >> Wow, I didn’t know that you could do that. >> >> However: "The details of that allocation are implementation-defined, and >> it's undefined behavior to read from the