Samual Sam has Published 2492 Articles

Math.sign() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 12:38:31

74 Views

The sign() function of the Math object accepts an integer number and returns its sign.(positive, negative)If the given number is a positive integer then, this function returns +1.And, if the given number is a negative integer then, this function returns -1.SyntaxIts Syntax is as followsMath.sign();Example Live Demo    JavaScript Example ... Read More

Math.trunc() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 12:37:50

68 Views

The trunc() function of the Math object accepts a number and returns its integral point (excluding the fractional part). If the given number itself is an integer this function returns the same.SyntaxIts Syntax is as followsMath.trunc();Example Live Demo    JavaScript Example           var result ... Read More

Math.cosh() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 12:35:37

31 Views

The cosh() function of the Math object accepts an angle (in radians) and returns its hyperbolic cosine value.SyntaxIts Syntax is as followsMath.cosh(90)Example Live Demo    JavaScript Example           var result = Math.cosh(90);       document.write("Hyperbolic cosine value of the given angle: "+result);   ... Read More

Math.sinh() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 12:34:10

31 Views

The sinh() function of the Math object accepts an angle (in radians) and returns its hyperbolic sine value.SyntaxIts Syntax is as followsMath.sinh(90)Example Live Demo    JavaScript Example           var result = Math.sinh(90);       document.write("Hyperbolic sine value of the given angle: "+result);   ... Read More

Math. fround() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 12:33:05

196 Views

The fround() function of the Math object accepts a floating point number and returns the nearest 32-bit single precision float representation of a Number. If the given number itself is an integer this function returns the same.SyntaxIts Syntax is as followsMath.fround(160.98)Example Live Demo    JavaScript Example     ... Read More

Math.imul() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 12:30:30

60 Views

The imul() function of the Math object accepts two numbers and returns the result of C-like 32-bit multiplication of the given numbers.SyntaxIts Syntax is as followsMath.imul(47, 56);Example Live Demo    JavaScript Example           var result = Math.imul(47, 56);       document.write("Result: "+result);     OutputResult: 2632

Java Program to subtract hours from current time using Calendar.add() method

Samual Sam

Samual Sam

Updated on 25-Jun-2020 12:29:02

465 Views

Import the following package for Calendar class in Java.import java.util.Calendar;Firstly, create a Calendar object and display the current date and time.Calendar calendar = Calendar.getInstance(); System.out.println("Current Date and Time = " + calendar.getTime());Now, let us increment the hours using the calendar.add() method and Calendar.HOUR_OF_DAY constant. Set a negative value since you ... Read More

Math.log10() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 12:28:31

99 Views

The log10() function of the Math object accepts a number and returns the natural logarithm (base 10) of the given number.SyntaxIts Syntax is as followsMath.log10(48);Example Live Demo    JavaScript Example           var result = Math.log10(48);       document.write("Result: "+result);     OutputResult: 1.6812412373755872

Math.log2() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 12:27:45

52 Views

The log2() function of the Math object accepts a number and returns the natural logarithm (base 2) of the given number.SyntaxIts Syntax is as followsMath.log2(48);Example Live Demo    JavaScript Example           var result = Math.log2(48);       document.write("Result: "+result);     OutputResult: 5.584962500721156

Math.acosh() function in JavaScript

Samual Sam

Samual Sam

Updated on 25-Jun-2020 12:26:11

30 Views

The acosh() function of the Math object accepts a number and returns its hyperbolic arc cosine value in radians. To convert the resultant value into degrees, multiply it with 180 and divide the result by 3.14159 (pi value).SyntaxIts Syntax is as followsMath.acosh(0.5)Example Live Demo    JavaScript Example   ... Read More

Advertisements