Re: Re: PDO types
| From: | Wez Furlong | Date: | Sun, 20 Feb 2005 15:46:01 +0000 |
| Subject: | Re: Re: PDO types | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15124@lists.php.net to get a copy of this message | ||
> > On Sun, 20 Feb 2005 12:36:01 +0100, Timm Friebe <thekid@thekid.de> wrote:
> > > * If the number does not fit, I will try to convert it into a double
> > > (PHP datatype float). This is the case for e.g. numeric(10) - values
> > > might not fit. This is the same what PHP does when adding 1 to
> > > LONG_MAX, for instance. If - in the procedure of doing so, strtod()
> > > gives an ERANGE or if the length overflows EG(precision), I will
> > > return a string.
> >
> > This is exactly what I wanted to avoid.
>
> Why is that so? I think this a good idea - it saves memory in the usual
> case (most numbers will probably fit into a long).
The problem is for the case where the mapping is not 1:1; you end up
changing a 100% precise value into a floating point "guess". String
has a higher fidelity than a float, and PDO prefers hi-fi any day.
> > Please don't make this change.
>
> How could I? I only have CVS karma for ext/sybase_ct, not for anything
> else, not Zend, not PDO:)
ack :)
Well, I meant really that you shouldn't spend time on it :)
--Wez.