Created
May 27, 2025 20:35
-
-
Save mutkuensert/e8cfaa29b0d12678adc711fcd2646a28 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
uint8_t mod256(uint16_t value) { | |
return static_cast<uint8_t>(value % 256); | |
} | |
int main() { | |
uint16_t sum = 0x02+ 0x01+ 0x00+0xFF+ 0xFF; | |
uint8_t result = mod256(sum); | |
std::cout <<std::hex<< static_cast<int>(result) << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment