Analysis of the efficiency of Python floating-point multiplication and shaping multiplication and division
Today Xiaobian to share with you about Python floating-point multiplication and shaping multiplication and division efficiency example analysis of the relevant knowledge points, detailed content, clear logic, I believe that most people are too aware of this knowledge, so share this article for your reference, I hope you can learn something after reading this article, let's take a look at it.
Problem: if it is determined that there are only two decimal places and do not explode the range, then there is a way to completely eliminate the use of floating point numbers.
Test 1. Shaping division and floating point multiplication
We add or subtract / 10 each time to simulate a float of 10%, multiply the floating point by 1.10.9 and correct the eps accuracy error.
The test code is as follows:
Int main () {const int Numb1e8; int64_t t1=clk (); for (int iTunes.