Top "Floating-point" questions

Floating point numbers are approximations of real numbers that can represent larger ranges than integers but use the same amount of memory, at the cost of lower precision.

How do I use floating-point division in bash?

I am trying to divide two image widths in a Bash script, but bash gives me 0 as the result: RESULT=$(($…

bash floating-point arithmetic-expressions
Python, print all floats to 2 decimal places in output

I need to output 4 different floats to two decimal places. This is what I have: print '%.2f' % var1,'kg =…

python floating-point string-formatting
Float and double datatype in Java

The float data type is a single-precision 32-bit IEEE 754 floating point and the double data type is a double-precision 64-bit …

java floating-point double ieee-754
Double vs. BigDecimal?

I have to calculate some floating point variables and my colleague suggest me to use BigDecimal instead of double since …

java floating-point double bigdecimal
How to round a floating point number up to a certain decimal place?

Suppose I have 8.8333333333333339, and I want to convert it to 8.84. How can I accomplish this in Python? round(8.8333333333333339, 2) gives 8.83 and …

python floating-point
How can I convert integer into float in Java?

I have two integers x and y. I need to calculate x/y and as outcome I would like to …

java integer floating-point
Why not use Double or Float to represent currency?

I've always been told never to represent money with double or float types, and this time I pose the question …

floating-point currency
What's the difference between a single precision and double precision floating point operation?

What is the difference between a single precision floating point operation and double precision floating operation? I'm especially interested in …

floating-point precision processor operations
Convert floating point number to a certain precision, and then copy to string

I have a floating point number, say 135.12345678910. I want to concatenate that value to a string, but only want 135.123456789. With …

python string floating-point
Get decimal portion of a number with JavaScript

I have float numbers like 3.2 and 1.6. I need to separate the number into the integer and decimal part. For example, …

javascript floating-point numbers decimal rounding