I am doing research on data types and I started with INT and Float. I did a simple loop that has an equation inside it. The loop is first executed with int data type and then with float . The code is done in objective c but the idea is that they take the same time. However, while checking the instruments tool in the xcode, it seems that the float run more cycles on the CPU.
Can anybody explain please?
I am doing research on data types and I started with INT and Float.
Share
Floating-point arithmetics is by far more complicated than integer arithmetics. Usually, CPUs even have a dedicated FPU circuitry to perform floating-point operations. Thus, what you have observed is to be expected.