KandZ – Tuts

We like to help…!

JavaScript 25 ๐Ÿงฌ Math Object

a - Info about Math object and its constants
The Math object in JavaScript is a versatile tool for performing a wide range of mathematical operations.
the Math object provides everything you need to handle most mathematical tasks in JavaScript.
From basic arithmetic and rounding to more advanced functions like trigonometry and random number generation
Constants:
E โ†’ Euler's number (approximately 2.718)
PI โ†’ Pi, the ratio of a circleโ€™s circumference to its diameter (approximately 3.14159)
SQRT2 โ†’ Square root of 2, approximately 1.414
LN2 โ†’ Natural logarithm of 2, approximately 0.693
LN10 โ†’ Natural logarithm of 10, approximately 2.303

b - Math object methods Part 1
Rounding Methods
Math.round() โ†’ Rounds a number to the nearest integer.
Math.ceil() โ†’ Rounds a number up to the nearest integer.
Math.floor(): โ†’ Rounds a number down to the nearest integer.
Exponential and Logarithmic Functions
Math.exp() โ†’ Returns the value of E raised to a given power.
Math.pow(base, exponent) โ†’ Returns the base raised to the exponent power.
Math.log() โ†’ Returns the natural logarithm (base E) of a number.
Other Basic Math Functions
Math.abs(): Returns the absolute value of a number.
Math.sign(): Returns the sign of a number. It can return -1, 0, or 1.

c - Math object methods Part 2
Trigonometric Functions
Math.sin(), Math.cos(), Math.tan() โ†’ These functions return the sine, cosine, and tangent of a given angle in radians.
Math.asin(), Math.acos(), Math.atan() โ†’ These functions return the arcsine, arccosine, and arctangent of a number.
Common Miscellaneous Methods
Math.max() โ†’ Returns the largest of zero or more numbers.
Math.min() โ†’ Returns the smallest of zero or more numbers.
Math.random() โ†’ Generates a random floating-point number between 0 (inclusive) and 1 (exclusive).

Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!

Leave a Reply