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

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

 



On Mon, 2006-06-05 at 22:00, tedd wrote:
> 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?

If I remember my abstract algebra correctly, the modulus operator forms
a set for any given value right operand. Interestingly then taking the
set of x%10 we find that adding 1 to x when x is 9 is indeed less than
9.

I'm sure I could summarize this better if I could remember my abstract
algebra and spaces *lol*. I remember vaguely proving spaces and stuff
based on various properties.

Either way the above exmaple gives a simple case where your assertion
also fails, and this is in the world of general mathematics.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

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