Find solutions to your problems with the expert advice available on IDNLearn.com. Get timely and accurate answers to your questions from our dedicated community of experts who are here to help you.
Sagot :
This was written in python, let me know if it needs to be in another language.
Answer:
Conditionals are slower than plain arithmetic operations, but much, much faster than something as silly as calculating the square root
Explanation:
integer or bitwise op: 1 cycle floating -point add/ sub/mul: 4 cycles . Floating- point div ~ 30 cycles Floating - point exponentiation :~ 60 cycles depending on implementation Conditional branch : avg. 10_ cycles, better if well- predicted , much worse if mispredicted.
We value your presence here. Keep sharing knowledge and helping others find the answers they need. This community is the perfect place to learn together. IDNLearn.com provides the best answers to your questions. Thank you for visiting, and come back soon for more helpful information.