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.

Convert String to Float in Swift

I'm trying to convert numbers taken from a UITextField, which I presume, are actually Strings, and convert them to Float, …

string floating-point swift string-parsing
Convert float to string with precision & number of decimal digits specified?

How do you convert a float to a string in C++ while specifying the precision & number of decimal digits? …

c++ string floating-point
C: convert double to float, preserving decimal point precision

i wanted to convert double to float in C, but wanted to preserve the decimal point exactly as possible without …

c floating-point double c89
splitting a number into the integer and decimal parts

Is there a pythonic way of splitting a number such as 1234.5678 into two parts (1234, 0.5678) i.e. the integer part and …

split floating-point python
PHP Convert String into Float/Double

I have list of string (size in bytes), I read those from file. Let say one of the string is 2968789218, …

php string floating-point implicit-conversion
Formatting floats without trailing zeros

How can I format a float so that it doesn't contain trailing zeros? In other words, I want the resulting …

python formatting floating-point pretty-print
Formatting doubles for output in C#

Running a quick experiment related to Is double Multiplication Broken in .NET? and reading a couple of articles on C# …

c# formatting floating-point ieee-754
How to check whether input value is integer or float?

How to check whether input value is integer or float? Suppose 312/100=3.12 Here i need check whether 3.12 is a float value …

java floating-point int rounding
Floating point inaccuracy examples

How do you explain floating point inaccuracy to fresh programmers and laymen who still think computers are infinitely wise and …

floating-point floating-accuracy
Converting Float to Dollars and Cents

First of all, I have tried this post (among others): Currency formatting in Python. It has no affect on my …

python python-3.x floating-point string-formatting currency