<div dir="ltr"><div dir="ltr"><div dir="ltr">These days (since version 6, 2014), the GNU Multiple Precision Library (<a href="https://gmplib.org/">https://gmplib.org/</a>) is available under LGPL v3, which is compatible with the Apache 2.0 license that Erlang is using (since OTP 18, 2015). Perhaps it would be a good idea to start using the heavily optimized GMP code now instead of Erlang's own bignum implementation. At least, to make it a build time option.</div><div dir="ltr"><br><div><div dir="ltr" class="gmail_signature">        /Richard</div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">Den sön 16 dec. 2018 kl 19:08 skrev Mikael Pettersson <<a href="mailto:mikpelinux@gmail.com">mikpelinux@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, Dec 15, 2018 at 8:19 PM Kostis Sagonas <<a href="mailto:kostis@cs.ntua.gr" target="_blank">kostis@cs.ntua.gr</a>> wrote:<br>
><br>
> On 12/15/18 7:30 PM, Mikael Pettersson wrote:<br>
> > On Fri, Dec 14, 2018 at 4:32 PM Kostis Sagonas<<a href="mailto:kostis@cs.ntua.gr" target="_blank">kostis@cs.ntua.gr</a>>  wrote:<br>
> >> We have been playing with CutEr (<a href="https://github.com/aggelgian/cuter" rel="noreferrer" target="_blank">https://github.com/aggelgian/cuter</a>), a<br>
> >> Concolic unit testing tool for Erlang, and discovered the following bug<br>
> >> in the implementation of bitwise and (band/2) operator:<br>
> >><br>
> >> Erlang/OTP 21 [erts-10.2] [source-2bf2b70] [64-bit] [smp:8:8]<br>
> >> [ds:8:8:10] [async-threads:1] [hipe] [sharing-preserving]<br>
> >><br>
> >> Eshell V10.2  (abort with ^G)<br>
> >> 1> (-1299341865233935136534120785510400) band (-1).<br>
> >> -1299341865233953583278194495062016<br>
> >><br>
> >><br>
> >> which is the wrong result, of course.<br>
> >><br>
> >> Most likely, it has existed forever.<br>
> > Looks like an old bug, I was able to reproduce it with every release<br>
> > back to R16B03 (R15B03 wouldn't build due to perl errors).<br>
><br>
> I was able to reproduce this on an old R12 version that I still have around:<br>
><br>
> Erlang (BEAM) emulator version 5.6.5 [source] [64-bit] [smp:64]<br>
> [async-threads:0] [hipe] [kernel-poll:false]<br>
><br>
> Eshell V5.6.5  (abort with ^G)<br>
> 1> (-1299341865233935136534120785510400) band (-1).<br>
> -1299341865233953583278194495062016<br>
><br>
><br>
> I would not be surprised if this bug existed even before Erlang/OTP<br>
> became open source.<br>
<br>
I did some more debugging, but wasn't able to pin-point the error (I<br>
have two suspects, but the big.c code is non-obvious so it's difficult<br>
to tell).<br>
Anyway, I opened <a href="https://bugs.erlang.org/browse/ERL-804" rel="noreferrer" target="_blank">https://bugs.erlang.org/browse/ERL-804</a> for this<br>
issue, linking back to your original post here.<br>
<br>
/Mikael<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>