RE: [PHP-DEV] Constants for better double edge case handling

2016-10-18 Thread Anatol Belski
Hi Kalle,

> -Original Message-
> From: kalle@gmail.com [mailto:kalle@gmail.com] On Behalf Of Kalle
> Sommer Nielsen
> Sent: Tuesday, October 18, 2016 9:05 PM
> To: Anatol Belski <anatol@belski.net>
> Cc: PHP Internals <internals@lists.php.net>; Davey Shafik <da...@php.net>; Joe
> Watkins <krak...@php.net>
> Subject: Re: [PHP-DEV] Constants for better double edge case handling
> 
> Hi Anatol
> 
> 2016-10-18 20:46 GMT+02:00 Anatol Belski <anatol@belski.net>:
> > Hi,
> >
> > I would like to suggest adding the following constants
> >
> > REGISTER_MAIN_LONG_CONSTANT("PHP_DBL_DIG", DBL_DIG,
> > CONST_PERSISTENT | CONST_CS);
> > REGISTER_MAIN_DOUBLE_CONSTANT("PHP_DBL_MAX", DBL_MAX,
> > CONST_PERSISTENT | CONST_CS);
> > REGISTER_MAIN_DOUBLE_CONSTANT("PHP_DBL_MIN", DBL_MIN,
> > CONST_PERSISTENT | CONST_CS);
> > REGISTER_MAIN_DOUBLE_CONSTANT("PHP_DBL_EPSILON", DBL_EPSILON,
> > CONST_PERSISTENT | CONST_CS);
> >
> 
> I like this idea but I do think that we should name them PHP_DOUBLE_* or
> PHP_FLOAT_* (preferably the first).
> 
Ah, indeed. PHP_FLOAT_* is what is consistent, probably.

Thanks

Anatol



--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Constants for better double edge case handling

2016-10-18 Thread Kalle Sommer Nielsen
Hi Anatol

2016-10-18 20:46 GMT+02:00 Anatol Belski :
> Hi,
>
> I would like to suggest adding the following constants
>
> REGISTER_MAIN_LONG_CONSTANT("PHP_DBL_DIG", DBL_DIG, CONST_PERSISTENT |
> CONST_CS);
> REGISTER_MAIN_DOUBLE_CONSTANT("PHP_DBL_MAX", DBL_MAX, CONST_PERSISTENT |
> CONST_CS);
> REGISTER_MAIN_DOUBLE_CONSTANT("PHP_DBL_MIN", DBL_MIN, CONST_PERSISTENT |
> CONST_CS);
> REGISTER_MAIN_DOUBLE_CONSTANT("PHP_DBL_EPSILON", DBL_EPSILON,
> CONST_PERSISTENT | CONST_CS);
>

I like this idea but I do think that we should name them PHP_DOUBLE_*
or PHP_FLOAT_* (preferably the first).


-- 
regards,

Kalle Sommer Nielsen
ka...@php.net

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php