Top "Precision" questions

For questions related to numerical precision in programming.

Limiting floats to two decimal points

I want a to be rounded to 13.95. >>> a 13.949999999999999 >>> round(a, 2) 13.949999999999999 The round function does …

python floating-point rounding precision
What is the difference between float and double?

I've read about the difference between double precision and single precision. However, in most cases, float and double seem to …

c++ c floating-point precision
How do I print a double value with full precision using cout?

So I've gotten the answer to my last question (I don't know why I didn't think of that). I was …

c++ floating-point precision iostream cout
decimal vs double! - Which one should I use and when?

I keep seeing people using doubles in C#. I know I read somewhere that doubles sometimes lose precision. My question …

c# double decimal precision currency
Get DateTime.Now with milliseconds precision

How can I exactly construct a time stamp of actual time with milliseconds precision? I need something like 16.4.2013 9:48:00:123. Is this …

c# datetime precision milliseconds
JavaScript displaying a float to 2 decimal places

I wanted to display a number to 2 decimal places. I thought I could use toPrecision(2) in JavaScript . However, if the …

javascript floating-point precision
Show two digits after decimal point in c++

Similar topic is already discussed in the forum. But I have some different problem in following code: double total; cin &…

c++ precision
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
How do I interpret precision and scale of a number in a database?

I have the following column specified in a database: decimal(5,2) How does one interpret this? According to the properties on …

sql database decimal scale precision
Double precision floating values in Python?

Are there data types with better precision than float?

python types precision