Code:what would take longer? add two bytes, or add two floats or add byte and float.
Code:what would take longer? add two bytes, or add two floats or add byte and float.
I been thinking bout this all day, cant figure any answer
You'd have to do it several million times to notice any difference with a profiler.
It would depend a lot on the hardware used, I would think. I can't see adding two bytes being slower than adding two floats, however.
Also note that adding a byte and a float would involve promoting the byte to a float first. I'm not sure how efficient that is -- probably very much so.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.