Re: Re: GMP and empty()
| From: | Yasuo Ohgaki | Date: | Mon, 30 Dec 2013 09:47:37 +0000 |
| Subject: | Re: Re: GMP and empty() | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70915@lists.php.net to get a copy of this message | ||
Hi Tjerk,
On Mon, Dec 30, 2013 at 3:42 PM, Tjerk Meesters <tjerk.meesters@gmail.com>wrote:
> This is because gmp_init() yields bool(false) if you pass a floating point
> value, as it should because it's meant for arbitrary-length **integers** ;-)
I forgot PHP's GMP implementation does not support float. Thanks.
And I was expecting
[yohgaki@dev php-src]$ ./php-bin -d error_reporting=-1 -r
'$f=2.2;$v=gmp_init($f); var_dump($v);'
Warning: gmp_init(): Unable to convert variable to GMP - wrong type in
Command line code on line 1
bool(false)
this kind of behavior for literal, too. ;)
Why is PHP not raising error for float literal?
--
Yasuo Ohgaki
yohgaki@ohgaki.net