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

Wow, I learned something today; I had always thought of integer multiplication as a constant-time operation.

This is why I love computer science, no matter how much I think I know, I can feel like an idiot a day later.




If by integer you mean the four or so bytes that many languages use to represent a (bounded) int, then it is indeed constant. This is often the context in software engineering.


I'm somewhat interested in compiler and computation theory, so this is why it was a surprise to me.


For some reason, a lot of people seem to think that operations that have a low level implementation (e.g. basic instruction in some ISA) are O(1).




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: