-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
69 lines (54 loc) · 2.6 KB
/
Copy pathindex.html
File metadata and controls
69 lines (54 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculator</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="app">
<div class="calculator">
<div class="formulaScreen">
</div>
<div class="outputScreen" id="display">
0
</div>
<button id="clear" value="AC">AC</button><button id="divide" value="/">/</button><button id="multiply"
value="*">x</button>
<button id="seven" value="7">7</button><button id="eight" value="8">8</button><button id="nine"
value="9">9</button><button id="subtract" value="-">-</button>
<button id="four" value="4">4</button><button id="five" value="5">5</button><button id="six"
value="6">6</button><button id="add" value="+">+</button>
<button id="one" value="1">1</button><button id="two" value="2">2</button><button id="three" value="3">3</button>
<button id="zero" value="0">0</button><button id="dot" value=".">.</button>
<button id="equals" value="=">=</button>
<div id="red-dot"></div>
</div>
<div id="features">
<h2>Features:</h2>
<ul>
<li>Basic arithmetic operations: addition, subtraction, multiplication, and division.</li>
<li>Decimal point support for floating-point calculations.</li>
<li>Clear (AC) button to reset the calculator.</li>
<li>Display of the current formula being entered.</li>
<li>Handling of operator precedence in calculations.</li>
<li><mark>Entering more than one arithmetic operator (+-*/) it will only consider the last one entered.</mark>
For example 3 + * 3 = 9
</li>
<li><mark>Pressing the equals button without entering a new number will repeat the last operation with the last
operand.</mark> For Example 2+5= then pressing = again</li>
<li>Float precision of 10 digits after the 0</li>
<li>If the result exceeds the display limit of 15 characters, it will be shown in exponential notation with 5
digits after the 0.</li>
<li>After a total is displayed, if a digit is pressed, it will start a new calculation using the total as the
first operand.</li>
<li><mark>Removed the bug in JavaScript for floats.</mark> Example 0.2 + 0.1 = 0.30000000000000004</li>
<li><mark>Truncate the output digits to a maximum of 15 (round if it's a float).</mark> A red dot will indicate
truncated digits.</li>
</ul>
</div>
</div>
<script src="./calculator.js"></script>
</body>
</html>