[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

What the fuck?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 15
Thread images: 1

File: Q_rsqrt.png (26KB, 647x478px) Image search: [Google]
Q_rsqrt.png
26KB, 647x478px
What the fuck?
>>
OwO whats this??
>>
>>56975239
WTF I HATE JOHN CORMACK
>>
>>56975239
inverse square root - i think this is some of the source from quake. This is John Carmacks code.
>>
Carmack didn't write it.

https://en.wikipedia.org/wiki/Fast_inverse_square_root#History_and_investigation
>>
>>56975239
wtf i have c now
>>
>>56975239
I still struggle with the
i = * (long *) &y

i is a "long" and y is a "float", but why do you need to do the address/reference casting instead of directly casting float to long?
>>
>>56977627
If they cast the float to long it will give an aproxinate value of the float. Thats not what they want. They want the bits of the float in an int variable.
>>
>>56977661
K k, i really appreciate why the one C book i read had such an emphasis on commenting; the algorithm is clever but is made much harder by the lack of clarity
>>
>>56977691
Why so? The "what thr fuck?" comment helps quite a bit.
>>
>>56977702
It's accurate on a meta-level comment, I'll give it that
>>
>>56977627
read it backwards

get the address of y, cast to a long type address, get the value at that address.
>>
>>56977792
What does that accomplish? What >>56977661 said?
>>
>>56976154
that's why he added that "what the fuck?" comment.
he didn't understand it
>>
>>56977854
yeah, it reads the float as if it was a long
Thread posts: 15
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.