Reply to Re: Butt ugly

Your name:

Reply:


Posted by Chung Leong on 05/28/06 07:57

Norman Peelman wrote:
> It makes sense because as soon as you try to ADD a number to a 'string'
> (or a 'string' to a 'string'), the strings are lost (counted as zero):

You might as well argue that 1 + 2 * 3 should equal 9. "As soon as you
add 2 to 1, you get 3..."

Addition and multiplication are communtative operations. 1 + 6 = 6 + 1
and 2 * 3 = 3 * 2. Thanks to precedence, they maintains their
properties in more complex expression: 1 + 2 * 3 = 1 + 3 * 2 = 3 * 2 +
1.

In PHP, because . and + have the same precedence, addition is no longer
communtative: "0." . 7 + 5 yields a different result from "0." . 5 +
7. So if you will, please explain how violating elementary mathematical
principles makes sense.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация