Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103282 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 86560 invoked from network); 29 Sep 2018 21:16:51 -0000 Received: from unknown (HELO mail-vs1-f51.google.com) (209.85.217.51) by pb1.pair.com with SMTP; 29 Sep 2018 21:16:51 -0000 Received: by mail-vs1-f51.google.com with SMTP id c10so19347vsk.2 for ; Sat, 29 Sep 2018 10:25:46 -0700 (PDT) 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=hhGSnbsp4YSCvP8O4gEpvvIJ923mczvfKJnUXZ39eZI=; b=pUNr4LtVi+i1RgfZOtfrxPD6eJDrjAvozn1RhnBHjk9L3/IZDod2ar46YbFshFWHEe ex84/Fstj1rgqz2qHbYSXfALWZslg2CF2dG772AUgWsFkkkjzgRXI33AFNivuOAOr2wV DG9bT/jYcJ7gO+pzgahvy287Eb/GeKjAabXSmMqmZOva9N6/u53XokHRudvWiJ4AYaSf p/MeyVMcwbmESQoThoDah740GJ2SAyQ5Aga6vtHCwXtmCR34hSCACEeSL6ylM33Z/nL8 3IVMs3mrqNYZm9AQk6cRw8mF2VcQGM/oavDQgj86sOsJ/OneiVK3EiFzDeXGGe/fmIGR G+CQ== X-Gm-Message-State: ABuFfoh+rEm1QnrhLW2zcqRSjKWFKZuR6XcY2yYx+bQGxkW58ASDPOxq gQZoqqRG/Mt2iHnWAZqifINacNBo X-Google-Smtp-Source: ACcGV62xBYF+9urjk4wgB/+on4mxLAC5A5Izic8vC5WMY3frvLRS47gVqAcxNeVMAHmoTEuWntLvtA== X-Received: by 2002:a67:26c2:: with SMTP id m185-v6mr578137vsm.230.1538241946300; Sat, 29 Sep 2018 10:25:46 -0700 (PDT) Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com. [209.85.217.52]) by smtp.gmail.com with ESMTPSA id x5-v6sm1755413vsa.27.2018.09.29.10.25.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Sep 2018 10:25:46 -0700 (PDT) Received: by mail-vs1-f52.google.com with SMTP id v12-v6so5378553vsc.1 for ; Sat, 29 Sep 2018 10:25:45 -0700 (PDT) X-Received: by 2002:a67:4b91:: with SMTP id f17-v6mr1500052vsg.66.1538241945743; Sat, 29 Sep 2018 10:25:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 29 Sep 2018 10:25:35 -0700 X-Gmail-Original-Message-ID: Message-ID: To: Sara Golemon Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000c137a9057705dc41" Subject: Re: [PHP-DEV] Extension: arbitrary precision decimal arithmetic in PHP 7 From: rtheunissen@php.net (Rudi Theunissen) --000000000000c137a9057705dc41 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I wrote a basic benchmark and GMPi appears to be about twice as fast (+ and - ops) but produces a different result. GMPi was also running out of memory when attempting to apply multiply and divide operators. The benchmark only uses + and - now. I used bcmath for the reference value. If there's a bug we can solve here, rather than a fundamental accuracy issue, GMPi looks promising. =F0=9F=98=8A See: https://gist.github.com/rtheunissen/973ea1719c02a4204dabfe9dffd78c4b On Sat, Sep 29, 2018, 07:20 Sara Golemon wrote: > On Fri, Sep 28, 2018 at 6:06 PM Rudi Theunissen > wrote: > > I've been working on adding arbitrary precision decimal support as an > > alternative to *bcmath. *I have created an extension based on > *mpdecimal*, > > which is what Python 3's decimal module is also based on. I haven't > > released or broadcast this project yet, because I wanted to discuss the > API > > and implementation with internals first. > > > Have you looked at GMPi ? https://github.com/sgolemon/gmpi > It's a replacement for GMP (which includes floating point and an OOP > interface). > > -Sara > --000000000000c137a9057705dc41--