& Lt; script & gt; alert (Math. round (1.4); // The value is 1; the nearest integer alert (Math. round (1.6); // The value is 2; the nearest integer alert (Math. floor (1.6); // The value is 1; alert (Math. floor (-1.6); // The value is-2; alert (Math. ceil (
Script
Alert (Math. round (1.4); // The value is 1; the nearest integer.
Alert (Math. round (1.6); // The value is 2; the nearest integer.
Alert (Math. floor (1.6); // The value is 1;
Alert (Math. floor (-1.6); // The value is-2;
Alert (Math. ceil (1.6); // The value is 2.
Alert (Math. ceil (1.1); // The value is 2.
Alert (Math. random () * 10); // obtain 0 ~ Random Number of 10
Alert (Math. abs (-1); // The value is 1 and the absolute value is obtained.
Script
Script
Alert (Math. round (1.4); // The value is 1; the nearest integer.
Alert (Math. round (1.6); // The value is 2; the nearest integer.
Alert (Math. floor (1.6); // The value is 1;
Alert (Math. floor (-1.6); // The value is-2;
Alert (Math. ceil (1.6); // The value is 2.
Alert (Math. ceil (1.1); // The value is 2.
Alert (Math. random () * 10); // obtain 0 ~ Random Number of 10
Alert (Math. abs (-1); // The value is 1 and the absolute value is obtained.
Script
You can copy and paste the Code to make it clearer.
From the cangkukuaimanle Column