- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10877 Articles for Web Development
274 Views
In this tutorial, we will learn how to get the tangent of a number in JavaScript. The tangent of an angle is defined by the ratio of the length of the opposite side to the length of the adjacent side. It can also be defined as the ratio of sine and cosine function of an acute angle where the value of cosine function should not be zero. Mathematically, ๐ก๐๐๐=๐๐๐๐๐กโ ๐๐ ๐กโ๐ ๐๐๐๐๐ ๐๐ก๐ ๐ ๐๐๐ / ๐๐๐๐๐กโ ๐๐ ๐กโ๐ ๐๐๐๐๐๐๐๐ก ๐ ๐๐๐ also, tanฮธ=(๐ ๐๐๐ ๐๐ ๐กโ๐ ๐๐๐๐๐ ๐)โ(๐๐๐ ๐๐๐ ๐๐ ๐กโ๐ ๐๐๐๐๐ ๐) Where ๐ = acute angle in radian The tangent of ... Read More
10K+ Views
In this tutorial, we will learn how to get the square root of a number in JavaScript in both ways. The square root of a number in JavaScript can be found in two ways โ Using Math.sqrt() Method By creating a Custom Function The square root of a number is a factor that, when multiplied by itself, gives the original number. For example, 10 is the square root of 100 because if you multiply 10 by itself (10*10), the result will be 100. Using the Math.sqrt() Method In JavaScript, The Math.sqrt() method is useful for finding the square ... Read More
139 Views
To get the sine of a number, use the JavaScript sine() technique. The sin technique returns a numeric value between -1 and one, that represents the sine of the argumentExampleYou can try to run the following code to get the sine of a number in JavaScript โ ย ย ย ย ย JavaScript Math sin() Method ย ย ย ย ย ย ย ย ย ย ย ย var value = Math.sin( 0.5 ); ย ย ย ย ย document.write("First Value : " + value ); ย ย ย ย ย ย ย ย ย ย var value = Math.sin( 90 ); ย ย ย ย ย document.write("Second Value : " + value ); ย ย ย ย ย
303 Views
To get a pseudo-random number between 0 and 1, use the Math.random() method in JavaScript.ExampleYou can try to run the following code to get a pseudo-random number between 0 and 1 โ ย ย ย ย ย JavaScript Math random() Method ย ย ย ย ย ย ย ย ย ย ย ย var value = Math.random( ); ย ย ย ย ย document.write("First Value : " + value ); ย ย ย ย ย value = Math.random( ); ย ย ย ย ย document.write("Second Value : " + value ); ย ย ย ย ย
487 Views
In this tutorial, we shall learn to find the smallest among numbers in JavaScript. Letโs discuss the available methods one after the other Using the Math.min() Method Here, the Math.min() is a static function of the placeholder object Math. If no parameters, the result is -Infinity. If the parameters are numbers, the result is the smallest among them. If any one of the parameters is not a number, the method returns NaN. This is an ECMAScript1 feature. Syntax Following is the syntax of Math.min() method โ Math.min(a1, a2, โฆan) Here, we need to give numbers as parameters. Parameters ... Read More
207 Views
In this tutorial, we will look at how to get the largest of zero or more numbers in JavaScript. The maximum of multiple numbers can be found using different techniques. The first technique we will introduce is the Math.max() method. The second technique will be the for-loop method. Following are the methods to get the largest of zero or more numbers in JavaScript โ Using the Math.max() Method We can use the Math.max() method to find the largest of many numbers. It returns the largest value from the given multiple values. The input parameters should be numbers or can ... Read More
264 Views
In this tutorial, we will learn how to get the natural logarithm of a number in JavaScript using Math.log() and Math.LN methods Since finding out the natural logarithm of a number through calculation is difficult, the methods like Math.log() and Math.LN is considered useful in JavaScript. You can use these methods not only in finding the length of a number in JavaScript but also while creating a calculation method for a number. Using the Math.log() Method The natural logarithm method is used to find a logarithm of a number with the base E. Compared to Math.LN method, while using Math.log() ... Read More
501 Views
In this tutorial, we will learn how to get the largest integer that can be less than or equal to a number in JavaScript. To get the largest integer less than or equal to a number, we use the Math.floor() method in JavaScript. It is used to round off a number supplied as a parameter to its closest integer towards the downward direction of rounding, i.e., towards the less significant value. Following are two ways in which we find the largest integer that can be less than or equal to a number in JavaScript. Using Math.floor() Method The method Math.floor() ... Read More
546 Views
In this tutorial, we will learn to calculate the logarithm of any number value and specify the base for the Math.log() method.The logarithmic operation of mathematics is beneficial in many places. For example, if you want to show the graph representation for billions of values, it is hard to render on the screen. For that, we change the scale of the graph using the logarithm, and it becomes easy to generate and visualize the output for any particular operation.There can be many more examples where we can use the logarithmic function.Calculate the log using the Math.log()Specify different bases for Math.log()Specify ... Read More
2K+ Views
To calculate the ln of a given number, use the Math.log() method in JavaScript. This method returns the natural logarithm (base E) of a number. If the value of a number is negative, the return value is always NaN.ExampleYou can try to run the following code to get the ln of a given number โ ย ย ย ย ย JavaScript Math log() Method ย ย ย ย ย ย ย ย ย ย ย ย var value = Math.log(2); ย ย ย ย ย document.write("Value : " + value ); ย ย ย ย ย
To Continue Learning Please Login
Login with Google