Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

decimal in python

>>> from decimal import *
>>> getcontext().prec = 6
>>> Decimal(1) / Decimal(7)
Decimal('0.142857')
>>> getcontext().prec = 28
>>> Decimal(1) / Decimal(7)
Decimal('0.1428571428571428571428571429')
Comment

Python Decimal

from decimal import Decimal
>>> Decimal('1.2')
Decimal('1.2')
Comment

Python Decimal

>>> (1.1 + 2.2) == 3.3
False
Comment

PREVIOUS NEXT
Code Example
Python :: how to skip next 5 iteration in python 
Python :: check object type python 
Python :: jinja macro import 
Python :: django.db.utils.ProgrammingError: relation "users" does not exist in django 3.0 
Python :: python allowed variable caracters 
Python :: tkinter entry 
Python :: python inner join based on two columns 
Python :: convert dictionary keys/values to lowercase in python 
Python :: get current data with python 
Python :: split a variable into multiple variables in python 
Python :: os.chdir python 
Python :: pandas dataframe 
Python :: dataframe row print 
Python :: python time library 
Python :: how to change plot size in matplotlib 
Python :: change to first letter capital list python 
Python :: skip element in list comprehension 
Python :: drupal 8 request_time 
Python :: add two list in python 
Python :: __file__ python 
Python :: read a csv and plot in python 
Python :: get absolute url django 
Python :: python iterate set 
Python :: regular expression to remove space python 
Python :: formatted string python 
Python :: date.month date time 
Python :: how to check how many items are in a list python 
Python :: bash python csv to json 
Python :: copy website 
Python :: python get file name 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =