Trying to learn as much as possible and give it back to the community using my blog: opensourc.es where "es" is more the german "it" than the spanish tld. So go out and opensource your projects!
It produces the same result that's all I said. Nevertheless in C++ it's compiled to the same (42*32) and 42 << 5 both to the latter because bit shifting is faster.
Trying to learn as much as possible and give it back to the community using my blog: opensourc.es where "es" is more the german "it" than the spanish tld. So go out and opensource your projects!
I didn't want that it uses multiplication. I thought it would be nice to mention that the result (mathematically) is the same instead of: it's changing the result to make a completely new number. Make it clear to the reader what this does and how to visualize it. Then people who don't know it can use it if they want to multiply by a power of two somewhere.
Trying to learn as much as possible and give it back to the community using my blog: opensourc.es where "es" is more the german "it" than the spanish tld. So go out and opensource your projects!
It produces the same result that's all I said. Nevertheless in C++ it's compiled to the same (42*32) and 42 << 5 both to the latter because bit shifting is faster.
I think it is better to be explicit in this case.😎
Without knowing the target system, using multiplication is a risk.🙁
I didn't want that it uses multiplication. I thought it would be nice to mention that the result (mathematically) is the same instead of: it's changing the result to make a completely new number. Make it clear to the reader what this does and how to visualize it. Then people who don't know it can use it if they want to multiply by a power of two somewhere.
Oh... Okay 👍🏽. You're right. Why I didn't do is because,I thought it would be confusing to the readers.
Fair enough. Maybe an extra box for extra information but understand your point.