• 1 Post
  • 19 Comments
Joined 10 months ago
cake
Cake day: July 12th, 2024

help-circle







  • why couldn’t you compute p/q < r/s by checking ps < rq?

    That’s what I meant by scaling the fractions. Tbh I kind of forgot that was an option and when I remembered I had allready written the part about comparing floats so I just left it in. But yeah, encoding lengh might be a killer there.

    You could also avoid reducing fractions the same way. Like I don’t neecessairly need my fractions to be reduced, if I am just doing a few equality comparisons per fraction. Of course I would have to reduce them at some point to avoid exceding the encoding lentgh in the enumerator and denominator when there is a representation with a short enough encoding available.

    I think the bigger problem might be the missing usecases. As another user mentioned, this would still only encode rationals perfectly (assuming no limit on encoding lengh). But I cannot see many usecases where having rationals encoded percisely, but irrationals still with an error is that usefull. Especially considering the cost.

    maybe we could solve this by prohibiting the end user from adding or multiplying numbers

    I genuently chuckled, thanks :).



  • needanke@feddit.orgtoProgrammer Humor@lemmy.mlIEEE 754
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    edit-2
    5 months ago

    I’ assume its because implemenring comparisons can’t be done efficiently.

    You’d either have to reduce a fraction every time you perform an operation. That would essentially require computing at least one prime decomposition (and the try to divide rhe other number by each prime factor) but thats just fucking expensive. And even that would just give you a quick equality check. For comparing numbers wrt </> you’d then have to actually compute the floating point number with enough percesion or scale the fractions which could easily lead to owerflows (comparing intmax/1 and 1/intmax would amount to comparing intmax^2/intmax to 1/intmax. The emcodinglengh required to store intmax^2 would be twice that of a normal int… Plus you’d have to perform that huge multiplication). But what do you consider enough? For two numbers which are essentially the same except a small epsilon you’d need infinite percision to determine their order. So would that standard then say they are equal even though they aren’t exectly? If so what would be the minimal percision (that makes sense for every concievable case? If not, would you accept the comparison function having an essentially unbounded running time (wrt to a fixed encoding lengh)? Or would you allow a number to be neither smaller, nor bigger, nor equal to another number?

    Edit: apparently some languages still have it: https://pkg.go.dev/math/big#Rat



  • If it was closed source I would agree but you can check for yourself if the code is good. Even if they are crazy.

    No I can not. I am not an android-dev, I am not the best dev out there and I don’t have time to thouroughly go through a big codebase. It would defenetly be possible to hide mallicious code from me, even if I have access to the source-code. For really big projects it is safe to assume other, more knowlegable people have allready audited the code, but for small ones I have to be able to trust the devs.



  • Their russian telegram channel has some opinions.

    Besides a chemtrail conspiracy - reference there is a whoule channel for the ru-ukr war. I am unsure if it is in support of the war or not and translating it does not really clarify it (sentiment gets lost easily I guess).

    Considering that, some clarification would be nice. Because I don’t think I would trust a software made by russian “patriots” (quote from the channel) in the current geopolitical landscape.