Explain Mathematical Functions used in Java Script

In order to perform several mathematical calculations java script has devoted mathematical functions, these are part of a built in java script object called “Math”. All functions used in complex mathematics must be accessed via this object.

Eg: var area = math.pi (r*r);
       var next = math.ceil (area);

Nan (Not a number):This is a value which represents something which is not a number.

abs(value):(absolute value) Returns the absolute value to the number passed into it.

acos(value), asin(value), atan(value): This function returns the arc cosine, arc signs& arc tangent respectively of the value passed into them.

ceil (value):- Returns the smallest integer which is greater than (or) equal to the value passed into it.

cos(value), sin(value),tan(value):- This function return the cosine, sign and tangent values respectively.

Floor (value):-Returns the largest integer which is smaller than (or) equal to the number passed init.

isnan(value): Returns ‘true’ if its argument is not a number and ‘false’ if its is a number.

log(value):- Returns the natural logarithm of its argument. If the argument is not a number (or) is a negative number then “nan” will be returned

Max (value1, value2):- Returns the larger of its argument.

Min (value 1, value 2):- Returns the smaller of its argument.

parseFloat (string): This function parse a string passed in as an argument and returns it is a floating point number.

pow (value, power):- Returns the raising value to power.

Round (value):-Return the result of rounding its argument to the nearest integer.

Random:-Return a random number between 0 & 1.

sqrt (value):- Return the square root of the value.

passeInt(string, [radix]):-The string is passed and its value is an integer in turn.

Once invalid character is encountered the passeInt stops and the function returns what it has already found.If the first character of the string is invalid ‘Nan’ is returned.

In base 2 only the characters 0 & 1 are permitted.In base 10 the digits 0 to 9 are permitted.
In base 16 the characters 0 to 9 are permitted and the letters a, b, c, d, e & f in lower (or) upper case are allowed.

If the string starts with ‘ox’ (zerox) the number is assumed to be hexadecimal.

Related

Web Technology 1440375696257326957

Post a Comment

emo-but-icon

item