From owner-freebsd-arch@freebsd.org Tue Jan 8 00:42:59 2019 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B03B71482A91 for ; Tue, 8 Jan 2019 00:42:59 +0000 (UTC) (envelope-from gavin.d.howard@gmail.com) Received: from mail-vk1-xa44.google.com (mail-vk1-xa44.google.com [IPv6:2607:f8b0:4864:20::a44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D716689A6E; Tue, 8 Jan 2019 00:42:58 +0000 (UTC) (envelope-from gavin.d.howard@gmail.com) Received: by mail-vk1-xa44.google.com with SMTP id o130so509202vke.10; Mon, 07 Jan 2019 16:42:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ApCutLvBUBOS4wfJ/cQa0cDCRBsEfUyw43hcdquPljk=; b=r4/lTD69KjgmESKwbrb5jUdkjluf+1mIs0zaZ22m4POKm5byI5yFWgq8WFCr0h9wHh BxALVQ4RQI4qCWqCfvP8G0sKy/NPoEAcRpoXFR5SyjIwEbY/QyisqyDrwtLdf2OFJoP4 buHsIIs2RRWN956G6H5lIQyMfvfy50jlb3W5yNTQcxXWL/xgzzPBRIa72LxvgtgaWMX8 MPK5uSIIPUYDhRvFMRadxrGjsYJEHpGdcCYDwv1oHPWEP/CWQsntfM9oqX+GSCnFYsak 211UUz0pRfnJbrvkbteUFdFQHUe/9W3yfWIytQDUZfZE0sLzkoJ3jvPwCOB0FpRTmD8Y slMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ApCutLvBUBOS4wfJ/cQa0cDCRBsEfUyw43hcdquPljk=; b=ANktPllQht7mt+Iu9lYeo6vOfKRJg1Ux7uxznJWHoXumnGFLKk5flbX/V/LbF40BXl CEkrwhWwb6BawzD9f72YBNZTrJ4Bhb1Z2bC51i0F/B1EuNHJiPMxCntFFo02Nmwce51+ adnqoruXrysJMoPRyezV4UuRUKndKGFYU/3M04xvS45QqS0vXCGWVPx/HQ/4+6nnkrqW 4Hh7iphgecs+xYYnJ9Xu7c20c00xusJKU0wDgWacDwfSnc7saOJbYfB6yJzH049ghLOl /yL66fLl/am24pNOtqTFTmRyza+jEYHcphdfVr23OtOTlNC01CeATX2rNgsNfftqfcsL 5UUA== X-Gm-Message-State: AJcUukd8PobHS/DkREDyTN2ozmfxEEbBBRJMW0NthELuclEPrqsyA24L GWbrNvfmicrXelRmsT90Ri9xy3VoJZP4YZJPqPLRiQ== X-Google-Smtp-Source: ALg8bN6HPnY8SR0kUQovHMIZGFvmcULfj5k7Xnax9to8jiyanR1cs9E/4XnD1uQOiP99nZkc9NcUXiEQsZlR+qoIG5c= X-Received: by 2002:a1f:5f55:: with SMTP id t82mr22934681vkb.60.1546908178055; Mon, 07 Jan 2019 16:42:58 -0800 (PST) MIME-Version: 1.0 References: <8FFA4578-0BAE-4F9F-8A06-AE83283BDEA4@FreeBSD.org> In-Reply-To: From: Gavin Howard Date: Mon, 7 Jan 2019 17:42:21 -0700 Message-ID: Subject: Re: GNU-compatible, BSD-licensed bc To: cem@freebsd.org Cc: Devin Teske , "freebsd-arch@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: D716689A6E X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=r4/lTD69; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gavindhoward@gmail.com designates 2607:f8b0:4864:20::a44 as permitted sender) smtp.mailfrom=gavindhoward@gmail.com X-Spamd-Result: default: False [-4.09 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.75)[-0.752,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-0.34)[ip: (2.28), ipnet: 2607:f8b0::/32(-2.21), asn: 15169(-1.68), country: US(-0.08)]; RCVD_IN_DNSWL_NONE(0.00)[4.4.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2019 00:43:00 -0000 On Mon, Jan 7, 2019 at 5:38 PM Conrad Meyer wrote: > > On Mon, Jan 7, 2019 at 4:00 PM Devin Teske 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. Also, the POSIX bc standard mandates doing math in decimal. OpenSSL would not be smart if they did that. There are also a few peculiarities with the POSIX bc standard that (more or less) require a standalone implementation. 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. Gavin Howard