Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use from _ _ future__ import division

Shulou Source: shulou.com Published: 2022-06-01 07:56:06 10月03日 Update

This article mainly explains "how to use from _ future__ import division". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use from _ future__ import division".

Import the future supported language features in python2 division (precise division), that is, from _ _ future__ import division, when we do not import this feature in the program, the "/" operator can only perform integer division, that is, take integers, only when we import division (exact algorithm), the "/" executes the exact algorithm. However, precise algorithms are already supported in python3, so there is no need to import division (precise algorithms):

The lab shows:

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license ()" for more information. > 71.4 > > 7credits credits 51 > from _ future__ import division > 71.4 > 71.4 > Thank you for your reading. That's all about how to use from _ future__ import division. After the study of this article, I believe you have a deeper understanding of how to use from _ future__ import division, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Precision algorithms learning content features support that is only that is ideas situations operators integers articles is in more knowledge knowledge points programs articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei macOS Linux Microsoft Apple