RUVIDEO
Поделитесь видео 🙏

How to use Math functions in Java with Examples | Java Sinhala | Part 17

📁 Обучение 👁️ 16 📅 02.12.2023

Basic Math methods java Math
Math.max(x,y) The Math.max(x,y) method can be used to find the highest value of x and y: ...
Math.min(x,y) The Math.min(x,y) method can be used to find the lowest value of x and y: ...
Math.sqrt(x) The Math.sqrt(x) method returns the square root of x:
Math.abs(x)

Method Description
Math.sqrt() It is used to return the square root of a number.
Math.cbrt() It is used to return the cube root of a number.
Math.pow() It returns the value of first argument raised to the power to second argument.
Math.signum() It is used to find the sign of a given value.

The Java Math class has many methods that allows you to perform mathematical tasks on numbers.

Math.max(x,y)
The Math.max(x,y) method can be used to find the highest value of x and y:

Example
Math.max(5, 10);

Math.min(x,y)
The Math.min(x,y) method can be used to find the lowest value of x and y:

Example
Math.min(5, 10);

Math.sqrt(x)
The Math.sqrt(x) method returns the square root of x:

Example
Math.sqrt(64);

Math.abs(x)
The Math.abs(x) method returns the absolute (positive) value of x:

Example
Math.abs(-4.7);

Random Numbers
Math.random() returns a random number between 0.0 (inclusive), and 1.0 (exclusive):

Example
Math.random();

To get more control over the random number, e.g. you only want a random number between 0 and 100, you can use the following formula:

Example
int randomNum = (int)(Math.random() * 101); // 0 to 100

? Connect with us on

? Follow us on Instagram - https://www.instagram.com/dappyoutube
? Follow us on Instagram - https://twitter.com/dappyoutube
? Like us on Facebook - https://www.facebook.com/javafreecode/
? Get Insights and tips from our Blog - http://www.ideclo.com


✌? Also, follow me on Github for some FreeCode: https://github.com/dotLK ✌?


✨? CHEARS! Thanks For Watching This Tutorial ✨

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «How to use Math functions in Java with Examples | Java Sinhala | Part 17», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.