RE: [PHP-DEV] Re: Constants for better double edge case handling
| From: | Anatol Belski | Date: | Wed, 19 Oct 2016 14:12:50 +0000 |
| Subject: | RE: [PHP-DEV] Re: Constants for better double edge case handling | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-96489@lists.php.net to get a copy of this message | ||
Hi Andrea,
> -----Original Message-----
> From: Andrea Faulds [mailto:ajf@ajf.me]
> Sent: Wednesday, October 19, 2016 2:49 PM
> To: internals@lists.php.net
> Subject: [PHP-DEV] Re: Constants for better double edge case handling
>
> Hi Anatol,
>
> Anatol Belski wrote:
> > Producing INF. There's currently no explicit way to produce INF and
> > NAN, whereby NAN is gettable with sqrt(-1).
> >
> > echo PHP_DBL_MAX*PHP_DBL_MAX, " ", -PHP_DBL_MAX*PHP_DBL_MAX; INF
> -INF
>
> I'm not sure I understand this use-case. We already have the INF and NAN
> constants for obtaining those values, and the standard IEEE 754 operations
> which produce these values are implemented (1/0 for INF, 0/0 for NAN,
etc.)
>
Ah, so then it is fine, thanks for the education. Then it'd stay by DBL_DIG
and DBL_EPSILON. While DBL_MAX/ DBL_MIN could still be useful in some case
(fe one would want to explicitly know the values), in most case it'd be
covered by INF.
Regards
Anatol