! we change the sign of the value if it isn't possible to change the sign this method returns 1 else return 0 and changing the sign */
| 103 | else return 0 and changing the sign |
| 104 | */ |
| 105 | uint ChangeSign() |
| 106 | { |
| 107 | /* |
| 108 | if the value is equal that one which has been returned from SetMin |
| 109 | (only the highest bit is set) that means we can't change sign |
| 110 | because the value is too big (bigger about one) |
| 111 | |
| 112 | e.g. when value_size = 1 and value is -2147483648 we can't change it to the |
| 113 | 2147483648 because the max value which can be held is 2147483647 |
| 114 | |
| 115 | we don't change the value and we're using this fact somewhere in some methods |
| 116 | (if we look on our value without the sign we get the correct value |
| 117 | eg. -2147483648 in Int<1> will be 2147483648 on the UInt<1> type) |
| 118 | */ |
| 119 | if( UInt<value_size>::IsOnlyTheHighestBitSet() ) |
| 120 | return 1; |
| 121 | |
| 122 | UInt<value_size> temp(*this); |
| 123 | UInt<value_size>::SetZero(); |
| 124 | UInt<value_size>::Sub(temp); |
| 125 | |
| 126 | return 0; |
| 127 | } |
| 128 | |
| 129 | |
| 130 |
no outgoing calls
no test coverage detected