Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70925 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44304 invoked from network); 30 Dec 2013 20:18:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Dec 2013 20:18:29 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.50 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.50 mail-la0-f50.google.com Received: from [209.85.215.50] ([209.85.215.50:64608] helo=mail-la0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/D1-33070-315D1C25 for ; Mon, 30 Dec 2013 15:18:28 -0500 Received: by mail-la0-f50.google.com with SMTP id el20so5853209lab.9 for ; Mon, 30 Dec 2013 12:18:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=1VNE+53pUNHpwIFJ16yp7Vyuwvav5GGP/xQsihIlo9I=; b=sDo7SevILPplhla3vYujqJBWIC/9Tfk7nV/difnwOy5CH6ivFC9QWXDXk2RVvsUAKy KEQy2AcU/I7+CKjfUeOccmqkuex2yuMxSus99vu5JmzCz9J7Il2UWpoGJKn4WfFN/1dP T9ncPaHWvtWYv/SwcZyEGbAT4DU4YbxTqAliw21q82YViAyhvvYuG0N5f+VoKLX5iQTG 6MmrW7ZyHFr4nIDVNGgqgMFH8wmRt7a6fgOlZY6K8C/ZvFroK2A8wKBvyyV19Le4XKYp kg/W/GEhpV6fUh3sjUy7XOsrF4z4xlp1/OG6ne26Mv3qmM1kUKq4o9gXRGuqRkb0RnNU 5a3g== X-Received: by 10.152.180.66 with SMTP id dm2mr62845lac.88.1388434704496; Mon, 30 Dec 2013 12:18:24 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.6.68 with HTTP; Mon, 30 Dec 2013 12:17:44 -0800 (PST) In-Reply-To: References: Date: Tue, 31 Dec 2013 05:17:44 +0900 X-Google-Sender-Auth: 70KYhVsNAkU0GAqQ5A4QMDxz7-M Message-ID: To: Nikita Popov Cc: Tjerk Meesters , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113458965afe1604eec6258d Subject: Re: [PHP-DEV] Re: GMP and empty() From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a113458965afe1604eec6258d Content-Type: text/plain; charset=UTF-8 Hi all, On Tue, Dec 31, 2013 at 4:35 AM, Yasuo Ohgaki wrote: > However, users can use them separately even if we add float support in GMP. > For example, when arithmetic contains with GMP int or int, then GMP int > should use > GMP int only. When arithmetic contains GMP float, then GMP int/PHP float > may be > promoted to GMP float, like PHP int is promoted to GMP int. > If we do this, GMP numbers work like Ruby numbers. [yohgaki@dev php-src]$ irb 2.0.0p247 :001 > 10 / 3 => 3 2.0.0p247 :002 > 10.0 / 3 => 3.3333333333333335 2.0.0p247 :003 > [yohgaki@dev php-src]$ php -a Interactive shell php > $g = gmp_init('10'); php > echo $g / 3; 3 php > echo 10 / 3; 3.3333333333333 It may be better to stick with PHP way, since we will have both Ruby like arithmetic and PHP arithmetic. Any comments? -- Yasuo Ohgaki yohgaki@ohgaki.net --001a113458965afe1604eec6258d--