Math.fround() Function in JavaScript

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

250 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           var result = Math.fround(160.98);       document.write("Fround value: "+result);     OutputFround value: 160.97999572753906

Nth Catalan Numbers in Java

Ankith Reddy
Updated on 25-Jun-2020 12:32:38

260 Views

The nth Catalan number in terms of binomial coefficients is calculated by the formula(n + k )/k where k varies from 2 to n and n ≥ 0. i.e.Cn = (2n)!/((n+1)!n!)Programpublic class NthCatalanNumber {    public static long fact(int i) {       if(i

Math hypot Function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 12:30:51

177 Views

The hypot() function of the Math object accepts numbers and returns the square root of the sum of squares of the given numbers.SyntaxIts Syntax is as followsMath.hypot(12, 58, 66);Example Live Demo    JavaScript Example           var result = Math.hypot(12, 58, 66);       document.write("hypot value: "+result);     Outputhypot value: 88.67919710958147

Math.imul Function in JavaScript

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

115 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

Display the Engine of a MySQL Table

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

1K+ Views

To know whether a MySQL table is using MyISAM or InnoDB engine then you can use below syntax.The below syntax can be used for multiple tables −show table status from yourDatabaseName;Here is the syntax that can be used for a specific table i.e. to know the engine of a table −show table status from yourDatabaseName Like ‘yourTableName’.The following is the query to display engine of all the tables −mysql> show table status from sampleTest;The following is the output −+--------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+ | Name          | Engine  | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | ... Read More

Get Class from an Object in Java

Krantik Chavan
Updated on 25-Jun-2020 12:30:16

292 Views

The runtime class of an object can be obtained using the java.lang.Object.getClass(). Also, the getName() method is used to get the name of the class.A program that demonstrates getting the class of an object using the getClass() method is given as follows −Example Live Demopublic class Demo {    public static void main (String [] args) {       Integer integer = new Integer(10);       Class c = integer.getClass();       System.out.println ("The class is: " + c.getName());       c = new Demo().getClass();       System.out.println ("The class is: " + c.getName());    } ... Read More

Compare Two Float Arrays in a Single Line in Java

Nancy Den
Updated on 25-Jun-2020 12:29:39

222 Views

Two float arrays can be compared in Java using the java.util.Arrays.equals() method. This method returns true if the arrays are equal and false otherwise. The two arrays are equal if they contain the same number of elements in the same order.A program that compares two float arrays using the Arrays.equals() method is given as follows −Example Live Demoimport java.util.Arrays; public class Demo {    public static void main(String[] argv) throws Exception {       boolean flag = Arrays.equals(new float[] { 1.5F, 8.3F, 7.6F }, new float[] { 1.5F, 8.3F, 7.6F });       System.out.println("The two float arrays are equal? ... Read More

Get Declared Method by Name and Parameter Type in Java

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

1K+ Views

The declared method can be obtained by name and parameter type by using the java.lang.Class.getDeclaredMethod() method. This method takes two parameters i.e. the name of the method and the parameter array of the method.The getDeclaredMethod() method returns a Method object for the method of the class that matches the name of the method and the parameter array that are the parameters.A program that gets the declared method by name and parameter type using the getDeclaredMethod() method is given as follows −Example Live Demopackage Test; import java.lang.reflect.*; public class Demo {    public String str;    private Integer func1() {     ... Read More

Math.log10 Function in JavaScript

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

151 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.log1p Function in JavaScript

karthikeya Boyini
Updated on 25-Jun-2020 12:28:08

93 Views

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

Advertisements