Software QA (13)
SQL Server (1)
Octal and Decimal Numbers
I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what's the problem?
If you assign a variable with a value of 0123, PHP will interpret as an octal number resulting to decimal value of 83.
All numbers that preceded with a 0 (zero) will be interpreted as octabl numbers. This is one of the PHP literal data rules. For example, the PHP script below will produce: 83 and 123.
<?php $octal = 0123; // octal number (equivalent to 83 decimal) $decimal = 123; // decimal number echo $octal ."\n"; echo $decimal ."\n"; ?>
2007-02-27, 8594👍, 0💬
How To Analyze Tables with "mysqlcheck"? - MySQL FAQs - Administrator Tools for Managing MySQL Serve...
How To Create an Add-to-Bloglines Button on Your Website? - RSS FAQs - Adding Your Feeds to RSS News...
Where are cookies actually stored on the hard disk? This depends on the user's browser and OS. In th...
Which one of the following statements is TRUE in regard to overloading the ++ operator? 1 You cannot...
Can each Java object keep track of all the threads that want to exclusively access to it?