Helion Bestsellery

Zabbix 7.0. Efektywny monitoring infrastruktury IT dla każdego
  • Autor: Mateusz Dampc
  • Zniżka: 40%
  • Cena: 69.00 41.40 zł
  • Marka: Helion
  • Status: Dostępna
  • Typ: Książka
  • EAN: 9788328920606
  • ISBN: 978-83-289-2060-6
Dodaj Zabbix 7.0. Efektywny monitoring infrastruktury IT dla każdego do koszyka

Helion Książka Dnia

My, programiści. Kronika koderów od Ady do AI
  • Autor: Robert C. Martin
  • Zniżka: 50%
  • Cena: 89.00 44.50 zł
  • Marka: Helion
  • Status: Dostępna
  • Typ: Książka
  • EAN: 9788328926509
  • ISBN: 978-83-289-2650-9
Dodaj My, programiści. Kronika koderów od Ady do AI do koszyka

Math.trunc()

[ Leksykon ] [ JavaScript ] [ Metody ] [ Właściwości ] [ Math() ]

Math.trunc()

[_] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z]

 

Przykłady:

console.log(Math.trunc(1.22)); // 1
console.log(Math.trunc(12.13)); // 12
console.log(Math.trunc(0.12345)); // 0
console.log(Math.trunc(-0.12345)); // -0
console.log(Math.trunc("-5.123")); // -5
console.log(Math.trunc(-0)); // -0
console.log(Math.trunc(0)); // 0
console.log(Math.trunc(-Infinity)); // -Infinity
console.log(Math.trunc(Infinity)); // Infinity

  

console.log(~(5.5)); // -6
console.log(~(-6)); // 5
console.log(~~(5.5)); // 5
console.log(~~(-5.5)); // -5

console.log(Math.trunc(5.5)); // 5
console.log(Math.trunc(-6)); // -6
console.log(Math.trunc(5.5)); // 5
console.log(Math.trunc(-5.5)); // -5

console.log(Math.floor(5.5)); // 5
console.log(Math.floor(-6)); // -6
console.log(Math.floor(5.5)); // 5
console.log(Math.floor(-5.5)); // -6

 

Opis:
Metoda Math.trunc() statyczna zwraca część całkowitą liczby, usuwając wszelkie cyfry ułamkowe. Parametr liczba. Zwracana wartość część całkowita parametru.

Linki:
Math.abs()
Math.ceil()
Math.floor()
Math.round()
Math.sign()

 

 

 

 

 

Please publish modules in offcanvas position.