Top "Precision" questions

For questions related to numerical precision in programming.

How to create a high resolution timer in Linux to measure program performance?

I'm trying to compare GPU to CPU performance. For the NVIDIA GPU I've been using the cudaEvent_t types to …

c linux timer precision high-resolution
How to display a number with always 2 decimal points using BigDecimal?

I am using BigDecimal to get some price values. Requirement is something like this, what ever the value we fetch …

java precision bigdecimal decimal-point
What range of numbers can be represented in a 16-, 32- and 64-bit IEEE-754 systems?

I know a little bit about how floating-point numbers are represented, but not enough, I'm afraid. The general question is: …

floating-point precision numerical ieee-754
Set the display precision of a float in Ruby

Is it possible to set the display precision of a float in Ruby? Something like: z = 1/3 z.to_s #=> 0.33333333333333 …

ruby floating-point precision
Is it safe to check floating point values for equality to 0?

I know you can't rely on equality between double or decimal type values normally, but I'm wondering if 0 is a …

c# .net floating-point precision zero
BigDecimal, precision and scale

I'm using BigDecimal for my numbers in my application, for example, with JPA. I did a bit of researching about …

java jpa scale precision bigdecimal
Find angle between hour and minute hands in an analog clock

I was given this interview question recently: Given a 12-hour analog clock, compute in degree the smaller angle between the …

math floating-point precision angle
Adjusting decimal precision, .net

These lines in C# decimal a = 2m; decimal b = 2.0m; decimal c = 2.00000000m; decimal d = 2.000000000000000000000000000m; Console.WriteLine(a); Console.…

.net decimal precision
What does "real*8" mean?

The manual of a program written in Fortran 90 says, "All real variables and parameters are specified in 64-bit precision (i.…

fortran precision bit fortran90
How to convert to double with 2 precision - string after dot?

I want to convert this string: 0.55000000000000004 to this double: 0.55. How to do that?

.net c#-4.0 double precision