Line data Source code
1 : #include "int.h"
2 : #include "hex.h"
3 :
4 15 : int32_t lengthInt(int32_t number)
5 : {
6 15 : int32_t value = 0;
7 15 : if(isHex(number)) {
8 0 : value = PARAMETER_IS_HEX;
9 : }
10 : else {
11 15 : value++;
12 15 : int numerator = number / 10;
13 30 : while(0 != numerator) {
14 15 : numerator = numerator / 10;
15 15 : value++;
16 : }
17 : }
18 15 : return value;
19 : }
20 :
21 0 : int32_t abs(int32_t number)
22 : {
23 0 : int32_t value = 0;
24 0 : if(isHex(number)) {
25 0 : value = PARAMETER_IS_HEX;
26 : }
27 : else {
28 0 : if(number < 0) {
29 0 : value = -number;
30 : }
31 : else {
32 0 : value = number;
33 : }
34 : }
35 0 : return value;
36 : }
37 :
38 7 : int32_t stringToInt(char* str)
39 : {
40 7 : int value = 0;
41 7 : return value;
42 : }
43 :
44 5 : int32_t hexToDecimal(int number)
45 : {
46 5 : int32_t value = 0;
47 5 : return value;
48 : }
|