Android programmers learn PHP development (5)-Boolean scientific notation-PhpStorm

Source: Internet
Author: User
In addition to the following code, we also need to talk about floating point numbers. float is an approximate number. for example, in java or js, 0.1 is added 10 times, and the result is 1.0000001 instead of 1. In addition to the following code, we also need to talk about floating point numbers. float is an approximate number. for example, in java or js, 0.1 is added 10 times, and the result is 1.0000001 instead of 1.

 Int (0)} --- true $ bool13 = new Iwanghang; // print the result: object (Iwanghang) #1 (0) {}--- real class Iwanghang {}$ bool14 = ord ("hello world"); // print the result: int (104) --- true, ord () the function returns the ASCII value of the first character of the string. $ Bool15 = 1.2e3; // print the result: float (1200) --- true, equivalent to 1.2*(10 to the power of 3) $ bool16 = 7E-10 + 1; // print the result: float (1.0000000007) --- true, equivalent to 7*(10-10 power) plus 1 $ bool17 = 3E + 5; // print the result: float (300000) --- true, equivalent to 7*(10 to the power of-10) $ bool18 = 0.00000000006; // float (6.0E-11) --- true $ bool19 = 3E-3; // float (0.003) --- true, if the number is small, 0.003 is displayed normally. $ bool16 is too long. If no value is added, the scientific notation var_dump ($ bool) is displayed. // print the result: bool (true) echo"
"; Var_dump ($ bool2); // print the result: bool (false) echo"
"; Var_dump ($ bool3); // print the result: int (0) --- false if ($ bool3) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool4); // print the result: float (0) --- false if ($ bool4) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool5); // print the result: float (0) --- false if ($ bool5) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool6); // print the result: string (0)" "--- false if ($ bool6) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool7); // print the result: string (1)" "--- true if ($ bool7) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool8); // print the result: string (1)" 0 "--- false if ($ bool8) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool9); // print the result: string (3)" 0.0 "--- true if ($ bool9) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool11); // print the result: array (0) {}--- false if ($ bool11) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool12); // print the result: array (1) {[0] => int (0)} --- true if ($ bool12) {echo "--- true";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool13); // print the result: object (Iwanghang) #1 (0) {}--- true if ($ bool13) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool14); // print the result: int (104) --- true if ($ bool14) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool15); // print the result: float (1200) --- true if ($ bool15) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool16); // print the result: float (1.0000000007) --- true if ($ bool16) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool17); // print the result: float (300000) --- true if ($ bool17) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool18); // print the result: float (6.0E-11) --- true if ($ bool18) {echo" --- true ";} else {echo "--- false" ;}; echo"
"; Var_dump ($ bool19); // print the result: float (0.003) --- true if ($ bool19) {echo" --- true ";} else {echo "--- false" ;}; echo"
";

The above is the content of PhpStorm, which is used by Android programmers to learn PHP development (5)-Boolean scientific notation. For more information, see PHP Chinese website (www.php1.cn )!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.