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 dangerous is it to compare floating point values?

I know UIKit uses CGFloat because of the resolution independent coordinate system. But every time I want to check if …

objective-c ios c floating-point floating-accuracy
Maximum value for Float in Java?

The following question indicates that the minimum value of a Double is -Double.MAX_VALUE. Is this also true for …

java floating-point minimum
How do I compute the square root of a number without using builtins?

how can I create a method that returns the sqrt of a given nunber? For example: sqrt(16) returns 4 and sqrt(5) …

algorithm math floating-point square-root
Convert Bytes to Floating Point Numbers?

I have a binary file that I have to parse and I'm using Python. Is there a way to take 4 …

python floating-point
Lua: converting from float to int

Even though Lua does not differentiate between floating point numbers and integers, there are some cases when you want to …

lua floating-point
Float formatting in C++

How do you format a float in C++ to output to two decimal places rounded up? I'm having no luck …

c++ floating-point cout
Why doesn't C have unsigned floats?

I know, the question seems to be strange. Programmers sometimes think too much. Please read on... In C I use …

c types floating-point format unsigned
When should I use the "strictfp" keyword in java?

I've looked up what this does, but does anyone actually have an example of when you would use the strictfp …

java floating-point strictfp
Swift - How to remove a decimal from a float if the decimal is equal to 0?

I'm displaying a distance with one decimal, and I would like to remove this decimal in case it is equal …

ios swift floating-point
why f is placed after float values?

I don't know why f or F is placed after float values in Java or other languages? for instance, float …

java floating-point