-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
92 lines (66 loc) · 2.03 KB
/
index.html
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html>
<head>
<meta charset = "UTF-8">
<title>Bitwise operations with string!</title>
<script language = "javascript" type = "text/javascript" src = "operator.js"></script>
</head>
<body>
<center>
<h3>NOTE:</h3>
<ul style = "display:inline-block">
<li>Please insert (positive/negative)decimal numbers into the text box as values.</li>
<br>
<li>Please use only the second text box for the "~" operator.</li>
<br>
<li>The system identifies the input numbers as strings.</li>
<br>
<li>To understand what internally happens please visit the wiki or/and analyse the "operator.js" file.</li>
</ul>
<br>
<h2>Bitwise arithmetic</h2>
<input type = "text" id = "BA_operand_one">
<select id = "BA_operators">
<option> ~ </option>
<option> & </option>
<option> ^ </option>
<option> | </option>
</select>
<input type = "text" id = "BA_operand_two">
=
<span id = "BA_result">None</span>
<br>
<br>
<button type = "button" onclick = "bitwise()">Calculate</button>
<br>
<br>
<h2>Shift</h2>
<input type = "text" id = "SH_operand_one">
<select id = "SH_operators">
<option> << </option>
<option> >> </option>
<option> >>> </option>
</select>
<input type = "text" id = "SH_operand_two">
=
<span id = "SH_result">None</span>
<br>
<br>
<button type = "button" onclick = "shift()">Calculate</button>
<br>
<br>
<h2>Interesting examples</h2>
<button type = "button" onclick = "example1()"> "2" * 2 </button>
<button type = "button" onclick = "example2()"> "8" | 1 </button>
<br>
<ul style = "display:inline-block">
<li id = "ex_one"></li>
<li id = "ex_two" ></li>
</ul>
<br>
<br>
For more explanation please visit -
<a href = "https://github.com/Incrementis/Javascript-bitwise-operations-with-string-inputs-/wiki"> bitwise operation with string Wiki</a>
</center>
</body>
</html>