Questions tagged [floating-point]
For challenges which are specific to numbers represented in floating-point format.
36
questions
2
votes
2
answers
468
views
Largest possible relative error
Output
\$20\$ float64s with absolute value between 1 and 2 inclusive whose sum has the largest possible relative error. We can assume the true sum is not zero.
The sum is to be computed from left to ...
13
votes
14
answers
4k
views
NaN is not equal to NaN
In many programming languages, the floating-point value NaN, or "not a number", in some programming languages generated by the expression ...
16
votes
3
answers
2k
views
Find 10 float64s that give the least accurate sum
Input
Integer \$n > 1\$
Output
Ten 64 bit floating point numbers between \$-n\$ and \$n\$, inclusive, whose sum is the least accurate.
Details and examples.
These examples are not claimed to be ...
14
votes
19
answers
3k
views
Vanilla Natural Logarithm Challenge
There is a challenge for multiplying two numbers so I guess this counts too
Given as input a positive real number n compute its natural logarithm.
Your answer ...
11
votes
4
answers
801
views
Implement Perceptron
There was a previous perceptron question but it was closed. Also it required a lot of extra stuff that's not normally part of the perception algorithm like I know it. This question will be much ...
19
votes
21
answers
6k
views
Convert an integer to IEEE 754 float
The task is simple: given a 32 bit integer, convert it to its floating point value as defined by the IEEE 754 (32-bit) standard.
To put it another way, interpret the integer as the bit-pattern of an ...
8
votes
2
answers
276
views
Implement Level-Index Addition
Level-index is a system of representing numbers which has been proposed as an alternative to floating-point formats. It claims to virtually eliminate overflow (and underflow, in its symmetric form) ...
15
votes
20
answers
1k
views
Cartesian - polar conversion couple
We don't have a challenge for conversion between Cartesian and polar coordinates, so ...
The challenge
Write two programs (or functions) in the same language:
one that converts from polar to ...
10
votes
9
answers
478
views
Durable Durations
Introduction
Time is a really simple concept. Seconds pass, one after the other, all the same. But humans love making it hard. This Stackoverflow question has gathered many answers and even though ...
21
votes
14
answers
3k
views
Bitwise XOR of floats
This is different from Floating Point XOR, and more in the spirit of a comment by R.. GitHub STOP HELPING ICE on that challenge, but I thought of this idea independently.
Generalized XOR
The bitwise ...
10
votes
13
answers
1k
views
8
votes
6
answers
618
views
KotH - Floating Point Prisoners Dilemma
Background
So, nowadays the popular Prisoner's Dilemma variant is the Prisoner's Trilemma, where there are three options. I can easily see that being increased, so I figured
Why settle for three ...
5
votes
21
answers
1k
views
Best Rolling Ao5
In speedcubing, an Ao5 (Average of 5) is computed for a set of five times by removing the fastest and slowest times, and then computing the mean of the remaining three times.
A "rolling ao5" ...
25
votes
8
answers
2k
views
Implement Ash's float division
Ash has a bit of an interesting float division algorithm. It's designed to never return NaN, and things like signed zero and infinity need to be handled.
How it ...
24
votes
37
answers
2k
views
Display the exponent from a binary floating point number as a decimal value
Had my software final exams recently, one of the last questions had me thinking for a while after the exam had finished.
Background
IEEE754 numbers are according to the below layout
The exponent is ...