About Data Processing

var num = 10; literal definition (custom message attributes undefined)
var num1 = new Number (10); presentation objects in the form of
 
infinity infinity 
-infinity equivalent to negative infinity
 
Arithmetic Math Object
 Execution: Common arithmetic algorithm
 
Common method 
  toFixed () to retain the specified number of decimal rounding results
  toString () into the corresponding digital binary string and into
Math properties
var PI = Math.PI uppercase identification constant pi
  Common method
 Math.abs () absolute value
    var num = -1; conosle.log (Math.abs (num))
 Math.ceil () rounding up 
 Math.floor () rounded down the parseInt () instead of
 Math.max () given maximum value
 Math.min () given minimum value
    
 Math.pow (x, y) returns the power of y x
   var x = 2, y = 4; var z = Math.pow (x, y); console.log (z);
Math.random () returns the random number to the numerical range
    (Max-min) * math.random () + min random number generation interval does not include the maximum value
          Including the maximum range
     (max-min+1)*math.random()+min
     max.ceil((max-min)*math.random()+min
Math.round () rounded integer value
Math.sqrt () square root 
   var f=16; conosle.log(Math.sqrt(f));

 

Guess you like

Origin www.cnblogs.com/GreenRadish/p/11128265.html