News for hackers. Stuff that matters.
Re:Bitfinex just spent $23.7M in fees to make a single Ether... by quotemstr on Monday September 27, 2021 @05:29PM (#28676260)
My position for ages now has been that it was a mistake to make floating point types first-class primitives in most programming languages. Integers and rationals should be the go-to types for most code most of the time. If you really need a IEEE float, you should reach into a library to get it.
Re:Bitfinex just spent $23.7M in fees to make a single Ether... by kevinpet on Monday September 27, 2021 @05:39PM (#28676364)
Well, this isn't very strong support for that position, because Ethereum doesn't support floating point, and yet here we are.
Re:Bitfinex just spent $23.7M in fees to make a single Ether... by jonny_eh on Monday September 27, 2021 @05:47PM (#28676439)
> Ethereum doesn't support floating point

The software that interacts with it does.

Re:Bitfinex just spent $23.7M in fees to make a single Ether... by rightbyte on Monday September 27, 2021 @05:39PM (#28676360)
I think you mixed up the problem. Had they used floats they would have got a small rounding error, not a 23 million loss.
Re:Bitfinex just spent $23.7M in fees to make a single Ether... by mhh__ on Monday September 27, 2021 @05:40PM (#28676373)
So all companies will automatically include the float library and thus nothing will change
Re:Bitfinex just spent $23.7M in fees to make a single Ether... by WillDaSilva on Monday September 27, 2021 @11:02PM (#28678836)
What you include as a first-class element in your languages, versus what is packed away in a library, will affect what developers do with your language.

For instance, Numpy provides array-language [1] capabilities to Python, but because it isn't a first-class element in the language Python is not thought of as an array language, and using it as one would be a bit clunky.

[1] https://en.wikipedia.org/wiki/Array_programming

Re:Bitfinex just spent $23.7M in fees to make a single Ether... by webkike on Tuesday September 28, 2021 @01:35AM (#28679659)
If the only thing you use computers for is processing financial transactions then that position is defendable
Re:Bitfinex just spent $23.7M in fees to make a single Ether... by abraae on Tuesday September 28, 2021 @02:19AM (#28679848)
Any number of sensors, measuring devices and other IoT stuff disagrees with you.
Re:Bitfinex just spent $23.7M in fees to make a single Ether... by MuffinFlavored on Monday September 27, 2021 @09:23PM (#28678221)
Dumb question on my end, I apologize.

How are rationals used to represent decimals?

Re:Bitfinex just spent $23.7M in fees to make a single Ether... by dragonwriter on Monday September 27, 2021 @09:26PM (#28678246)
> How are rationals used to represent decimals?

Decimals are just the subset of rationals where the denominator is always a power of 10, so the representation and arithmetic operations are simple if you already have rational support (though if you need to preserve decimal results, you need approximation logic for division, since dividing two rationals with denominators that are powers of 10 may result in a rational with a denominator that is not a power of 10.)

Re:Bitfinex just spent $23.7M in fees to make a single Ether... by thaumasiotes on Monday September 27, 2021 @09:37PM (#28678310)
> though if you need to preserve decimal results, you need approximation logic for division, since dividing two rationals with denominators that are powers of 10 may result in a rational with a denominator that is not a power of 10.

This is also true for adding, subtracting, and multiplying, though in those cases it is always trivial to convert the result into a form where the denominator is a power of 10.