Perform Gray Addition
Objective
Given two non-negative integers encoded in unbounded-length Gray code, add them and output the result, where the result is also encoded in Gray code.
Gray code
There are many equivalent formulation of Gray code, but here's an intuitive one.
The Gray code encodes ea...
i know how to fix it, should i just repost the whole thing with the fix
yeah ill just do that one sec
CMC: (corrected) write a program/function F such that for any positive rational A, F(A) = positive rational B, F(B) = C, and C is between A and B (exclusive)
3
(failing for precision/size limits is allowed but the code must be theoretically correct of course)
Oh, and gonna throw this up on the starboard as well, cause, while he wasn't a CM for as long as Catija, he was one of the most active CMs on our site, if you check the edits :P
@cairdcoinheringaahing Glad you're better (if you are by now)! Yeah losing those two CMs really sucks, and I'm sure as a mod y'all'll feel it even more than us
It really does feel like SE's walking through a room of legos and making a beeline to step on every one they see sometimes
Slowly recovering. Had to get a meningitis vaccination and it's kicked me in the teeth. And yeah :/ Less than a month ago, V2 was in 20th byte doing the regular check-in
it's bittersweet as well, I just hit 1 year as a mod, where, tbh, Slate, Catija and V2Blast have been the CMs I've interacted with. And now, 2 of them are gone
@cairdcoinheringaahing Oh hey, I got a Men B vaccination like a week ago. All I got was just a super sore arm tho (doesn't help my friend likes patting people on the shoulder >:|)
@RydwolfPrograms This is actually the second time I got vaxxed against it, cause my exchange uni requires vaccinations and I couldn't get my records back home, so they just went, "Get another one" :P
@CommandMaster your random factored integer code is great
I haven't had a chance to profile it but I did notice that it gets much slower when the bit size goes up. Is that the primality tests that slow down or is there more rejection do you think?
I did have a question, I don't really understand all your optimizations. If I change int x = std::uniform_int_distribution<>(vI/2+1, vI)(rng); to be (1, vI)(rng) instead should I still expect the outputs to be correctly distributed? In other words, are any of the optimizations tailored to the exact question being asked?
well if we're talking bach that music was all super structured so i wouldnt be surprised if there were literaly written algorithms
@CommandMaster im totally down to add your tex bounty to the absurd thematic bounty post; do you have permission to edit it in or would i have to add it / make it community wiki or something?