Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
You way overuse parentheses, and the only thing you _don't_ use them for is to fix is the multilevel fraction.
-
-
iiii90854y@Wisecrack I mean that division is the most expensive operation which brings the most amount of rounding errors
-
-
Not entirely a shit post.
For those who don't get it. When you invert a number, Its bit get swapped hence resulting to the opposite value of it.
Example:
let Age = 12;
// 12 in binary is =>>> 1100
// when inverted is => 0011
let invAge = invert(Age);
// Hence Inverted Age (invAge) will equal 3
The Use-case:
There are a couple of scenarios where this might be helpful. One would be to have a numerical similarity measure that quantifies how close two lists are to each other. So, for example, Let's say we have two lists that contain some products with two different people and a rank beginning from the top-ranked to the least-ranked. From these two lists, We can then calculate inversions which would quantify how similar/dissimilar these two people are to one another making filtration faster.
@Wisecrack called the given method of generating an inverted number a shit post cus the solution was hard coded rather than implementing a functional logic even if it works. -
pipe3264y@GiddyNaya The simplification of that expression is (z0×z2×z3)/(z1×z4×z5×n), and since z0×z2×z3 = z1×z4×z5, the whole expression is just equal to 1/n (and that's why it works for any n).
It mathematically inverts n, indeed, but with a lot of useless computation (so that may still be a shitpost overall). I doubt it also inverts its binary representation though. -
Clearly well past the Ballmer peak. Now go write some fun commit messages and push to master it’ll be fun 😃
-
@electrineer
"What are you even trying to do if you end up with this"
Don't play coy. You know the game and so do I. -
@GiddyNaya I'm just gonna go with your explanation. Yep, that was definitely what the goal was.
Related Rants
If you want a really obtuse method for inverting numbers in python, here you go:
z0 = Decimal('78.56341431805592768684300246940000494686645802145994376216014333')
z1 = Decimal('1766612.615660056866253324637112675800498420645531491441947721134')
z2 = Decimal('1766891.018224248707391295083927186110075710886547799081463050088')
z3 = Decimal('15658548.51274600264911287951105338985790517559073271799766738859')
z4 = Decimal('1230189034.426242656418217548674280136397763003160663651728899428')
z5 = Decimal('1.000157591178577552497828947885508869785153918881552213564806501')
((((z0/(z1/(z2/(n)))))*(z3))/z4)/z5
From what I can see, it works for any value of n.
I have no clue why it works.
Also have a function to generate the z values for any n input.
Shitpost studios.
Bringing you QUALITY math posts since 2019!
"we shitpost because we care."
devrant
math