The function seems to work well for x in the range of -128 to 128, but it may exhibit unexpected behavior for x outside of this range.

