Questions tagged [floating-point]

For questions about floating-point, a numerical representation format used in computing to represent and perform arithmetic operations on real numbers.

Filter by
Sorted by
Tagged with
5 votes
6 answers
890 views

What are the consequences of allowing decimal-point-less number literals to be interpreted as floats?

In some languages, a number literal's type can be inferred from nearby expressions. For example, 1u64 + 2 might give a u64 value ...
Rydwolf Programs's user avatar
14 votes
12 answers
7k views

Can sine converge to zero at infinity?

In common languages, sine produces an error, NaN, or exception when evaluated at infinity. For example, in Python: ...
Corbin's user avatar
  • 724
4 votes
4 answers
398 views

What goes wrong when division-by-zero is defined as multiplication-by-infinity?

Sometimes, we want to implement floating-point operations on systems which use IEEE 754 representations of values, but don't necessarily support IEEE 754 semantics. For example, we may be using the <...
Corbin's user avatar
  • 724
5 votes
3 answers
292 views

Reading Floating Point, perhaps without libc/msvcrt

Given a new language, how best should we convert decimal to binary floating point? And please don't just say "use strtod(3)": The venerable C function supports a baroque variety of weird ...
Ian's user avatar
  • 153
13 votes
7 answers
2k views

How to handle periodic functions of very large floats

(Or really just poor conditioning in general.) Recently, there has been some interest in correctly-rounded floating-point libraries (RLIBM and CORE-MATH), which I think is great, but there is one ...
Moonchild's user avatar
  • 789
21 votes
5 answers
5k views

Are x87 long doubles still relevant?

Intel created a series of floating-point coprocessors for the x86 called the x87. In addition to supporting IEEE single and double precision numbers, it also supported an 80-bit extended precision ...
Bbrk24's user avatar
  • 8,857
13 votes
8 answers
536 views

Pros and cons of throwing an error versus returning a NaN value

So I've seen that many languages return a NaN value when calculating an indeterminate arithmetic expression (e.g. 0/0). Other ...
The Empty String Photographer's user avatar
12 votes
5 answers
1k views

What are the pros and cons of fixed-point arithmetics vs floating-point arithmetics?

From Wikipedia: In computing, fixed-point is a method of representing fractional (non-integer) numbers by storing a fixed number of digits of their fractional part. ... More generally, the term may ...
justANewbie's user avatar