-
Notifications
You must be signed in to change notification settings - Fork 0
/
Comparison Operator.sol
49 lines (39 loc) · 1.07 KB
/
Comparison Operator.sol
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
pragma solidity >= 0.7.0 < 0.9.0;
// contract SolidityTest {
// uint storedData;
// constructor() public{
// storedData = 10;
// }
// function getResult() public view returns(string memory){
// uint a = 1; // local variable
// uint b = 2;
// uint result = a + b;
// return integerToString(result);
// }
// function integerToString(uint _i) internal pure
// returns (string memory _uintAsString) {
// if (_i == 0) { //comparison operator
// return "0";
// }
// uint j = _i;
// uint len;
// while (j != 0) { //comparison operator
// len++;
// j /= 10;
// }
// bytes memory bstr = new bytes(len);
// uint k = len - 1;
// while (_i != 0) {
// bstr[k--] = byte(uint8(48 + _i % 10));
// _i /= 10;
// }
// return string(bstr);//access local variable
// }
// }
contract ComparisonOperators {
uint a = 4;
uint b = 6;
function compare() public{
require(a > b, 'That is false'); //
}
}