<header>
<h2 class="title">Math.clz32()</h2>
<p class="description">Повертає кількість початкових нульових бітів у 32-бітному бінарному представленні числа.</p>
</header>
<main>
<div class="result">
<label for="inputNumber">Введіть число:</label>
<input type="number" id="inputNumber">
<button onclick="calculateCLZ32()">Обчислити</button>
<p id="output">Результат буде відображено тут</p>
</div>
</main>
body {
font-size: 16px;
line-height: 1.5;
font-family: monospace;
}
header {
background-color: #f1f1f1;
margin-bottom: 25px;
padding: 15px;
box-shadow: 0px 0px 3px 0px rgba(118, 118, 118, 1);
box-shadow: 0px 0px 3px 0px rgba(118, 118, 118, 1);
box-shadow: 0px 0px 3px 0px rgba(118, 118, 118, 1);
}
header h2.title {
padding-bottom: 15px;
border-bottom: 1px solid #999;
}
header p.description {
font-style: italic;
color: #222;
}
.result {
background-color: #f8f8f8;
padding: 15px;
box-shadow: 0px 0px 3px 0px rgba(118, 118, 118, 1);
box-shadow: 0px 0px 3px 0px rgba(118, 118, 118, 1);
box-shadow: 0px 0px 3px 0px rgba(118, 118, 118, 1);
}
button {
margin-left: 10px;
}
#output {
margin-top: 15px;
font-weight: bold;
}
function calculateCLZ32() {
const number = document.getElementById('inputNumber').value;
const result = Math.clz32(number);
document.getElementById('output').innerHTML = 'Результат: ' + result;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.