doc: update documentation and tests for `toUIntX` functions (#5497)

Update documentation on functions to reflect actual behavior.
Add tests to ensure said behavior is as documented.

Closes #5483
3 files changed