On 21/02/15 19:56, Pádraic Brady wrote:
> 1. Happy to see leading/trailing spaces excluded.
Fixed length fields may well be a data source so having to strip them
before using them just seems a backward step. The basic C library simply
strips the white space so are we looking at using an alternative?

> 2. Rules don't make mention of leading zeroes, e.g. 0003
Again data may well be zero padded. This is more likely to be historic
material, but it's yet another extra processing step. If we have to
process data before then asking if it's a valid number what is the
advantage of this? However of cause the C library switches to octal mode
and needs pre processing of leading zero's anyway.

> 3. "1E07" might be construed as overly generous assuming we are
> excluding stringy integers like hex, oct and binary
Yet again ... If we have to add a lot of extra checks then why can't we
simply ask if the data is a usable integer. At the end of the day it
does depend on where the data was sourced? Binary data is only usable if
we know that it is binary, or we will be converting some other format
anyway?

> 4. I'm assuming the stringy ints are rejected?
Source material may be 'stringy ints', so all that does is say "we can't
use the original variable it has to be converted" rather than we can and
use it's 'non-stringy' view.

> 5. Is ".32" coerced to float or only "0.32"? Merely for clarification.
Omitting the leading zero is normal when doing hand keyed data entry.
.32 is a valid data entry ... Omitting perhaps 20% of characters speeds
data entry.

> 6. Boolean coercion from other types... Not entirely sure myself.
> Completely off the cuff: <=0: false, >0:true, floats and strings need
> not apply.
That would be a major BC break!

> 7. In string to float, only capital E or also small e?
lower case e is common ...

> 8. I'll never stop call them "stringy" ints.
For some funny reason we tend to prefer to view numbers on the screen as
strings ... having the original string with a value which can be used
for calculation is simply how I thought PHP worked. A variable is more
than just a 'value', we need it's name which is a string, and a viewable
string could be useful, along with other flags. I had assumed up until
now that PHP was using that model but it seems not :(

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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

Reply via email to