Hacker News new | past | comments | ask | show | jobs | submit login

If he's in base 100 and you multiply by 18 it's the same story: you are now in base 1000 and need a division to go back.

Converting from binary to BCD also needs division by constants, so again it's more or less the same.




Oh, right. I'm an idiot who forgot about the fixed point divide.

And yes, at some point you are going to need to do a divide by constant 10. It's unavoidable if you want a base 10 display. The option of using BCD to do calculations just lets you do that divide upfront, rather than at the end.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: