Get the App
SLTechnology News&Howtos  ›  Development  › 

Analysis of the efficiency of Python floating-point multiplication and shaping multiplication and division

Shulou Source: shulou.com Published: 2022-05-31 16:44:48 09月28日 Update

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.

Tags: Multiplication floating point knowledge articles tests code constants results multiplication and division examples case analysis efficiency multiplication and division analysis content or different large large Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Linux Apple Xiaomi Microsoft