Re: When is "z" != "z" ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 8:18 PM -0500 6/5/06, Larry Garfield wrote:
>See how the comparison works?  It's a purely alphabetic comparison.
>
>As for the increment, it actually would never have occurred to me to ++ a
>string before this thread, honestly. :-)  However, what it appears to be
>doing (and I'm sure Rasmus will correct me if I'm wrong) is using a "string
>base" instead of a numeric base.  Thus a++ = b, b++=c, etc.  z++ "rolls over"
>to the next "digit" (which because it's a string goes to the right rather
>than the left), and resets.  So just as 9++ rolls over to 10, z rolls over to
>aa.
>
>Does that make more sense?

Maybe to you, but not me.

In my book, you can't add a positive value to z and produce something that is less than z.

For example, "aa" is not greater than "z" -- is it?

Besides, what "value" are we adding? There is no incremental "character" in strings and adding two characters doesn't evaluate to anything.

In my last post I showed an "actual sequence" which is debatable. It could be interpreted that the infinite set starts at "a, aa, aaa,... " and never reaches "b". Oddly enough, this could be viewed in all sorts of ways. It's probably best if we don't look at characters as numbers.

tedd
-- 
------------------------------------------------------------------------------------
http://sperling.com  http://ancientstones.com  http://earthstones.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux