On 19/02/15 12:47, François Laupretre wrote:
> I didn't add restrictions specific to number representation in the draft 
> ruleset yet, becausen while I think that's an important point, I didn't have 
> time to study it in depth.
> 
> I know you're an expert on this as you continuously (rightly) raised the 
> point.
> 
> So, can you elaborate on this and send me or, better, publish on the list the 
> detailed set of changes you suggest, including 32 bit vs 64 bit concerns if 
> they fit. Today, conversion restrictions are rather limited as floats which 
> don't fit in int give 0, and int to float is considered as always possible. I 
> mean that must be technically incorrect, while unnoticed in the vast majority 
> of cases.
> 
> So can you write a consistent set of changes you would introduce ?

François ... My main interest in this over the years has been while
trying to port data between different engines, and that includes porting
legacy data from older systems such as dbase some of which originates
from 8 bit processor days.

One area that overlays the general discussion is the simple size of a
scalar value, and this just mirrors the number of bytes used to store
it. I1, I2, I4 and I8, but a more general validation facility on top of
'integer' would be a simple range.

decimal or numeric and float may get lumped together, but integer is a
much better base for decimal/numeric since it is lossless and simply
moves the position of the decimal point. Storage only requires an
integer of the appropriate size for the number of digits.

float is another miss used definition since it normally only allows for
32 bits of data, while double expands that to 64 bits. So once again the
platform may affect how these values are processed.

Pierre - You may think that the size   of integer is irrelevant in the
discussion on providing a strict type use of it, but in practice it is
somewhat important if the codebase you are creating is only 32bit but
all the data being handled is 64bit.

-- 
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