Category "decimal"

Decimal module in Python inaccurate

from decimal import * Pi=Decimal(3.141592653589793238462643383279502884197169399373) print(Pi) Actual output: 3.14159265358979311599796346854418516159057617187

Minimal decimal number in pandas dataframe

I'm trying to make a dataframe in pandas where all columns have at least 6 decimals. I've tried splitting the decimal numbers on their . and look at the decimal

What does this error mean, and how do I rectify it?

system.overflow exception: value too small or too large I'm busy with a loan calculator app. In the code below, I'm trying to calculate the loan payment (paymen

Ho to convert base 10 floating point input to base 2 in MIPS?

I have been tasked with writing a program in MIPS that converts a user-inputted base 10 floating point number to base 2. I am a relatively inexperienced program

Decimal quantity step for specific product categories in WooCommerce

I would like to adjust quantity step for specific product categories to allow decimal numbers (0.5 steps specifically). A bit like in Set quantity minimum, maxi

How to get org.apache.kafka.connect.data.Decimal value from Kafka JSON message [duplicate]

I use debizium to stream postgresql data to Kafka, and use Java to subscribe Kafka topic. I receive Kafka message and get a JSON string, but

Manage independently the decimal number of the price of each product [duplicate]

I develop an online store with woocommerce and I would like to display the price of the product with 3 decimals when the price contains 3 (exa

How to avoid failing with Decimal function when 0/0 occurs?

I have a Python 2.7 script and it uses two lists and divides the numbers to each other then creates a new list with the results and it is working fine but it er

Set output size in bc library

I'm using the bash bc library to perform inter-base conversions. Does anyone know if it is possible to set the output size (number of bits/bytes)? I need his ou

Counting number of digits of input using python

I am trying to count the number of digits of an input. However, whenever I input 10 or 11 or any two digit number, the output is 325. Why doesn't it work? inpu

How to print decimal notation rather than scientific notation in Python?

Assume to have this number: p=0.00001 Now, if we print this variable we get 1e-05 (i.e., that number in scientific notation). How can I print exactly 0.00001

Is there a way to make a complex number in NumPy with the accuracy of a Decimal type?

I'm working in Python with NumPy arrays of complex numbers that extend well past the normal floating point limits of NumPy’s default Complex type (numbers