-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmath.js
More file actions
23 lines (20 loc) · 1.89 KB
/
math.js
File metadata and controls
23 lines (20 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Zwrócenie wartości "Pi" // Returning the value of "Pi".
const pi = Math.PI; // 3.141592653589793
const element2 = Math.SQRT2; // 1.4142135623730951 // Pierwiastek kwadratowy z 2. // Square root of 2
const logarithm2 = Math.LN2; // 0.6931471805599453 // Logarytm naturalny z 2. // Natural logarithm of 2.
const logarithm10 = Math.LN10; // 2.302585092994046 // Logarytm naturalny z 10. // Natural logarithm of 10.
const rounding1 = Math.round(logarithm10); // Zaokrąglij do najbliższej liczby całkowitej. //Round to the nearest whole number.
const rounding2 = Math.ceil(2.1); // Zaokrąglenie w górę. // Rounding up.
const rounding3 = Math.floor(2.6); // Zaokrąglenie w dół. // Rounding down
const rounding4 = Math.trunc(2.859302); // Nowość w JS E6 usuwa to co po przecinku i zostaje tylko liczba całkowita. // New in JS E6 removes what comes after the decimal point and only the integer remains.
const signMethoda = Math.sign(0); // Ujemna = -1, Wynosi 0 = 0, Dodatnia = 1; // Negative = -1, Rises 0 = 0, Positive = 1;
const exponentiation = Math.pow(2, 6); // Potęgowanie liczb. // Exponentiation of numbers.
const square = Math.sqrt(64); // Pierwiastek z liczby. //Square root.
const returnAnAbsoluteValue = Math.abs(-5.55); // Zwrócenie wartości bezwzględnej. // Returning an absolute value. // 5.55
const minimumNumber = Math.min(-4, -12, 2, 5, 79); // Zwrócenie wartości minimalnej z jakiegoś zbioru. // Return the minimum value from some set.
const MaximumNumber = Math.max(); // Zwrócenie wartości maksymalną z jakiegoś zbioru. // To return the maximum value from some set.
const drawingNumbers = Math.floor((Math.random() * (50 - 1) + 1)); // Losowanie liczb określenie maksymalnej i minimalnej. // Drawing numbers to determine the maxima and minima.
// Losowanie liczb. // Drawing of numbers.
var drawingNumbers1 = 123;
var email = "test" + drawingNumbers + "@example.com";
console.log(email);