Hi all,
There has been GMP number discussion and made draft RFC for it.
Please comment so that I can add more to the RFC.
Thank you.
--
Yasuo Ohgaki
yohgaki@ohgaki.net
-----Original Message-----
From: yohgaki@gmail.com [mailto:yohgaki@gmail.com] On Behalf Of Yasuo Ohgaki
Sent: Tuesday, December 31, 2013 12:44 AM
To: internals@lists.php.net
Subject: [PHP-DEV] [RFC][DRAFT] GMP number as PHP numberHi all,
There has been GMP number discussion and made draft RFC for it.
Please comment so that I can add more to the RFC.Thank you.
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Here the link to yasuo's RFC
https://wiki.php.net/rfc/gmp_number
On float support in GMP extension: Big +1, and I'd be happy to implement it.
On promotion/demotion between gmp/int and gmp/float: I suspect we can keep these as a single user-type, regardless of libgmp's internal representation of them, so it's a rather moot point.
On overloading empty() to deal with objects that have a notion of emptiness: I'd like you to split that out into a separate rfc and a separate discussion. It's prthogonal to the floating point issue. ((But I would be tentatively for it))
On auto-parsing gmp objects into base scalars (such as for math function arguments): Again, this feels like it should be a separate rfc, particularly since it comes with a number of open issues around how we deal with overflows, loss of precision, and whether or now we attempt to magically rebox the result on return from the function (possible, but massively problematic).
-Sara
-----Original Message-----
From: yohgaki@gmail.com [mailto:yohgaki@gmail.com] On Behalf Of Yasuo Ohgaki
Sent: Tuesday, December 31, 2013 12:44 AM
To: internals@lists.php.net
Subject: [PHP-DEV] [RFC][DRAFT] GMP number as PHP numberHi all,
There has been GMP number discussion and made draft RFC for it.
Please comment so that I can add more to the RFC.Thank you.
--
Yasuo Ohgaki
yohgaki@ohgaki.netHere the link to yasuo's RFC
https://wiki.php.net/rfc/gmp_number
Hi Sara,
On float support in GMP extension: Big +1, and I'd be happy to implement
it.
I appreciate if you implement it!
I'll concentrate on encoding and session improvement :)
Anyway, we already got new year.
Happy new year to all of folks!
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
On float support in GMP extension: Big +1, and I'd be happy to implement
it.I appreciate if you implement it!
I'll concentrate on encoding and session improvement :)
I've pulled the GMP float proposal out of
https://wiki.php.net/rfc/gmp_number and fleshed it out a bit as
https://wiki.php.net/rfc/gmp-floating-point
-Sara
Hi Sara,
On float support in GMP extension: Big +1, and I'd be happy to implement
it.I appreciate if you implement it!
I'll concentrate on encoding and session improvement :)I've pulled the GMP float proposal out of
https://wiki.php.net/rfc/gmp_number and fleshed it out a bit as
https://wiki.php.net/rfc/gmp-floating-point
I don't mind removing old RFC at all.
I moved my RFC to "Withdrawn" section as reference.
Thank you for your effort!
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi Sara,
On float support in GMP extension: Big +1, and I'd be happy to implement
it.I appreciate if you implement it!
I'll concentrate on encoding and session improvement :)I've pulled the GMP float proposal out of
https://wiki.php.net/rfc/gmp_number and fleshed it out a bit as
https://wiki.php.net/rfc/gmp-floating-point
Any updates on this?
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi all,
There has been GMP number discussion and made draft RFC for it.
Please comment so that I can add more to the RFC.Thank you.
RE empty(): There is nothing special that needs to be done to implement
this. To support empty() one simply has to implement the IS_BOOL cast. The
reason I haven't implemented it in the first place is the common C++
programmer wisdom that you should never, ever overload the bool operator
without using the safe bool idiom or an explicit operator (both not
available in PHP, of course). But given that I already have GMP to string,
double and int conversions implemented, it doesn't seem entirely
unreasonable to also allow checking for GMP(0) via !$gmpNum as well. If the
general opinion is that we want this behavior, I can add it.
Nikita
Hi!
double and int conversions implemented, it doesn't seem entirely
unreasonable to also allow checking for GMP(0) via !$gmpNum as well. If the
general opinion is that we want this behavior, I can add it.
I think making (bool)GMP(0) be false and (bool)GMP(others) true may make
sense. Though of course that would require people who check various
factory methods by doing != false or such be extra careful to use !== or
something like that. But that should be the case even now.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227