3 ms·
Just write a function “mydiv10” which returns if x < 99 { x /10 and 0 otherwise and try again.
by acqq 8y ago
Just write a function “mydiv10” which returns if x < 99 { x /10 and 0 otherwise and try again.
- acqq 8y agoLike this: https://godbolt.org/z/bS2yzB https://godbolt.org/z/bS2yzB But also note that when the input is unsigned short we get: https://godbolt.org/z/sbDbMU https://godbolt.org/z/sbDbMU movzx eax, di imul eax, eax, 52429 shr eax, 19