Re: [RFC] Safe Casting Functions
| From: | Marc Bennewitz | Date: | Sun, 26 Oct 2014 19:43:26 +0000 |
| Subject: | Re: [RFC] Safe Casting Functions | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78353@lists.php.net to get a copy of this message | ||
On 24.10.2014 20:54, Andrea Faulds wrote:
>> On 24 Oct 2014, at 19:52, Marc Bennewitz <php@mabe.berlin> wrote:
>>> Floats are special, they are not expected to be precise. If we reject this, then
>>> perhaps we should also reject 0.1, because it can’t be precisely represented by a float?
>> It's a difference casting string to float or int to float.
>> Floats are often used to make sure an argument is a valid number but
>> this results in data loss incl. on internal functions.
> You’re not using the right function, then.
That's not the point!
We already have casting functions what will work in all cases even on
data loss.
I thought you are proposing "safe" casting functions with no data loss.
If not, what are you proposing ?
Marc