Basic Python 31: Decimal | Python смотреть онлайн
Python Decimal:
------------------------
Python built-in class float performs some calculations that might amaze us. We all know that the sum of 1.1 and 2.2 is 3.3
ex:
(1.1 + 2.2) == 3.3
it is False
Why it is False?
It turns out that floating-point numbers are implemented in computer hardware as binary fractions as the computer only understands binary (0 and 1). Due to this reason, most of the decimal fractions we know, cannot be accurately stored in our computer.
Let's take an example. We cannot represent the fraction 1/3 as a decimal number. This will give 0.33333333... which is infinitely long, and we can only approximate it.
It turns out that the decimal fraction 0.1 will result in an infinitely long binary fraction of 0.000110011001100110011... and our computer only stores a finite number of it.
This will only approximate 0.1 but never be equal. Hence, it is the limitation of our computer hardware and not an error in Python.
ex:
1.1 + 2.2
3.3000000000000003
we can use the decimal module that comes with Python. While floating-point numbers have precision up to 15 decimal places, the decimal module has user-settable precision.
ex:
import decimal
print(0.1)
print(decimal.Decimal(0.1))
It also preserves significance. We know 25.50 kg is more accurate than 25.5 kg as it has two significant decimal places compared to one.
ex:
from decimal import Decimal as D
print(D('1.1') + D('2.2'))
print(D('1.2') * D('2.50'))
When to use Decimal instead of float?
- When we are making financial applications that need exact decimal representation.
- When we want to control the level of precision required.
- When we want to implement the notion of significant decimal places.
___________________ API Automation __________________
➡️ Rest Assured Using Java → https://youtube.com/playlist?list=PLQKDzuA2cCjrxlZkE8e_NOeQFJQXRHp0n
➡️ Karate Framework using Maven → https://youtube.com/playlist?list=PLQKDzuA2cCjoWKMw8bpnOlr70PNSVdkf6
______________ Programing Language _____________________
➡️ Basic Python → https://youtube.com/playlist?list=PLQKDzuA2cCjp-gnUFFPvXcMllAlfVPph5
➡️ Core Java → https://youtube.com/playlist?list=PLQKDzuA2cCjod85qsWBGR-25onbE1GH_i
____________ Performances Testing ____________________
➡️ JMeter Beginner → https://youtube.com/playlist?list=PLQKDzuA2cCjrukNp3JNCTnKi89C9CiFz8
➡️ Locust Beginner → https://youtube.com/playlist?list=PLQKDzuA2cCjptRRRUWyLZoaeVuoctG35L
____________ Git and GitHub ______________________________
➡️ Git and GitHub Beginner → https://youtube.com/playlist?list=PLQKDzuA2cCjrsvfgzsVajJVqj7rck7X2q
______________Manual Testing _____________________
➡️ Manual Testing → https://youtube.com/playlist?list=PLQKDzuA2cCjovVbXzK8QiVeZamz-lLW0-
_______________Automation Testing ___________________
➡️ Selenium Cucumber Framework using Java → https://youtube.com/playlist?list=PLQKDzuA2cCjpsMVO0Cj_JIDURpJSzVcmn
➡️ Robot Framework with Python → https://youtube.com/playlist?list=PLQKDzuA2cCjrVs8t8_b4LTguHA1XGTZI_
➡️ Beginner Karate Framework using Intellij → https://youtube.com/playlist?list=PLQKDzuA2cCjqUiNSoEtGJSAuDYvleZcpQ
➡️ Karate Framework with Gradle using eclipse → https://youtube.com/playlist?list=PLQKDzuA2cCjo_VayskAv-1qnUg1b2mjWi
➡️ Basic Selenium WebDriver using Java → https://youtube.com/playlist?list=PLQKDzuA2cCjpEL8xZFg6I1TOcerxKh0nX
➡️ TestNG Framework → https://youtube.com/playlist?list=PLQKDzuA2cCjoKVdgCDCuCnUMFv-9jZ2cr
➡️ Robot Framework with RIDE → https://youtube.com/playlist?list=PLQKDzuA2cCjqmT4GambzrUjtLfEkXmMzw
_________________ Beginner Jenkins _____________________
➡️ Beginner Jenkins → https://youtube.com/playlist?list=PLQKDzuA2cCjrwNyMgYffggbTMoNrtwpGk
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Basic Python 31: Decimal | Python» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.