GNU-compatible, BSD-licensed bc

Devin Teske dteske at FreeBSD.org
Tue Jan 8 05:57:48 UTC 2019



> On Jan 7, 2019, at 4:42 PM, Gavin Howard <gavin.d.howard at gmail.com> wrote:
> 
> On Mon, Jan 7, 2019 at 5:38 PM Conrad Meyer <cem at freebsd.org> wrote:
>> 
>> On Mon, Jan 7, 2019 at 4:00 PM Devin Teske <dteske at freebsd.org> wrote:
>>> How do you handle arbitrary arithmetic precision?
>> 
>> Looks like https://github.com/gavinhoward/bc/blob/master/src/num.c .
> 
> That is correct. Because this bc is meant to help bootstrap the Linux
> kernel and have no dependencies other than POSIX 2008, I wrote my own.

Impressive. It might be worth turning this into a library itself.


> Also, the POSIX bc standard mandates doing math in decimal. OpenSSL
> would not be smart if they did that.

Not sure I understand what you mean here.


> There are also a few
> peculiarities with the POSIX bc standard that (more or less) require a
> standalone implementation.
> 

How hard would it be to convert a bn(3)-based library to use your code?
Would there be any performance impact -- I've benchmarked bn(3) to
be pretty fast.


> Also, right now I am working on getting a release candidate out that
> will enable me to make a quick port that Stefan could use as a jumping
> off point. My build system changed between 1.0 and now, and I would
> like to be able to test it.
> 

Cool. Looking forward to it.
-- 
Cheers,
Devin


More information about the freebsd-arch mailing list