This commit is contained in:
Philippe Torrel
2026-06-17 11:00:40 +02:00
parent f39de9f3b4
commit 1903c9fcf7
4 changed files with 67 additions and 7 deletions

View File

@@ -0,0 +1,56 @@
<!doctype html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Numbers</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" />
<style>
h1 {
color: #ff9900; /* rgb(255, 153, 0) */
}
</style>
</head>
<body>
<main>
<div class="container py-5">
<h1>Numbers</h1>
<video src="https://i.imgur.com/FKwTYak.mp4" controls></video>
</div>
</main>
<script>
'use strict';
// Binär (0b = Binary)
let binaryExample = 0b1101; //=> 13
// Oktal (0o = Octal)
let octalExample = 0o17; //=> 15, 7 * (8^0) + 1 * (8^1) = 15
let octalExample2 = 0o223; // = 147, da (3 * 1) + (2 * 8) + (2 * 64)
// Hexadezimal (0x = Hex)
let hexExample = 0xff; //=> 255, da 15 * (16^0) + 15 * (16^1)
// 15 + 240
// 0 - 9 A - F
// Exponential (z.B. 123e5 = 12300000)
let exponentialExample = 123e5; // 12300000
console.log(exponentialExample);
console.log('Binär:', binaryExample, typeof binaryExample); // 13 , 'number'
console.log('Oktal:', octalExample, typeof octalExample); // 15 , 'number'
console.log('Hexadezimal:', hexExample, typeof hexExample); // 255 , 'number'
console.log('Exponential:', exponentialExample, typeof exponentialExample); // 123000 , 'number'
// BigInt (2020) vs. Number
let bigNumber = 1234567890123456n;
let normalNumber = Number.MAX_SAFE_INTEGER; // => 9007199254740991 - Maximale sichere Zahl (Number): 2^53
console.log('Max Number: ', normalNumber);
console.log(typeof bigNumber); // 'bigint'
// Gleitkommazahlen-Präzision
console.log('0.1 + 0.2 =', 0.1 + 0.2); // 0.30000000000000004
</script>
</body>
</html>