Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73771 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94119 invoked from network); 24 Apr 2014 08:17:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2014 08:17:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.175 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.175 mail-ob0-f175.google.com Received: from [209.85.214.175] ([209.85.214.175:49641] helo=mail-ob0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/31-13812-098C8535 for ; Thu, 24 Apr 2014 04:17:21 -0400 Received: by mail-ob0-f175.google.com with SMTP id wp4so2273032obc.20 for ; Thu, 24 Apr 2014 01:17:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=WxaCcuOcPi0sFg6J/WN8tSaHG0T3mLkjBtalTgSxeT8=; b=hxLBCUhzTiCvOuyR7H/9Q1O8HYNao0Z81NBlYA6nqIgPOK00h/0PqMK3mfDfeYAYsc 1oW2R7Pddx5uKmDkdi4AzzkZ2+am0elFXhHwI2fhrRO7Fy4sLhW82x0/2d99cgHUtzLE lk9EmOg34+xsnnJkRUb8wx9yG/oHrovc021I7aGAGGvrH/r2zy284Etfu278izLxL5WM xS/ixUvYOmp0tQ0duo3MDNfLEB3NjdRMe4uTU/f5/bfsx9KMiYo3tR+cO3ACjRQRiF51 rPek0thUOiRSa4fzPvnal94endNMNztLkZV7mjkFOcqM/noIoKbrZ4+U1NHRzh2iuMd4 dg5A== MIME-Version: 1.0 X-Received: by 10.182.22.18 with SMTP id z18mr363302obe.42.1398327438575; Thu, 24 Apr 2014 01:17:18 -0700 (PDT) Received: by 10.182.69.101 with HTTP; Thu, 24 Apr 2014 01:17:18 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 Apr 2014 10:17:18 +0200 Message-ID: To: Park Framework Cc: PHP internals Content-Type: multipart/alternative; boundary=001a11332d16418eac04f7c57a18 Subject: Re: [PHP-DEV] [RFC] Floating Point support in GMP extension From: nikita.ppv@gmail.com (Nikita Popov) --001a11332d16418eac04f7c57a18 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Apr 21, 2014 at 10:40 PM, Park Framework wrote: > Concept is simple. > Need, remove GMPInt, leave only GMPFloat. > For backward compatibility in php.ini set default values > =E2=80=8B=E2=80=8Bgmp.default_precision =3D 0 > Anyone who wants to work with float, must specify precision > 0 > What do you think about this? > This is not possible, because GMP integers and GMP floats are fundamentally and inherently different types. A GMP integer isn't just a GMP float with zero precision. Actually, what I think you're missing here is that the GMP floating point type is just that: A **floating** point type. This means that it is **not** precise. What you specify as the GMP float precision actually translates to the size of the mantissa/significand, not the number of places after the comma. GMP integers on the other hand are precises. Furthermore a primary application for GMP integers are computations over cyclic groups, as well as other number theoretic computations. The operations for these are not a available for the floating point type (and frankly, wouldn't really make sense). Maybe you're looking for the BCMath extension? Nikita --001a11332d16418eac04f7c57a18--