nave@lemmy.zip to Lemmy Shitpost@lemmy.worldEnglish · 8 months agoI wishi.imgur.comimagemessage-square188fedilinkarrow-up1928arrow-down117
arrow-up1911arrow-down1imageI wishi.imgur.comnave@lemmy.zip to Lemmy Shitpost@lemmy.worldEnglish · 8 months agomessage-square188fedilink
minus-square257m@sh.itjust.workslinkfedilinkarrow-up1·8 months agoWhats the alternative a macro? An inline function is perfectly fine for checking if a nunber is even. Compiler will probably optimize it to a single and instruction.
minus-squarehomura1650@lemmy.worldlinkfedilinkarrow-up2·edit-28 months agoNo. The alternative is to not use a float. Testing if a float is even simply does not make sense. Even testing two floats for equality rarely makes sense. What is the correct output of isEven((.2 + .4) ×10) Hint: (.2 + .4) x 10 != 6
Whats the alternative a macro? An inline function is perfectly fine for checking if a nunber is even. Compiler will probably optimize it to a single and instruction.
No. The alternative is to not use a float. Testing if a float is even simply does not make sense.
Even testing two floats for equality rarely makes sense.
What is the correct output of isEven((.2 + .4) ×10)
Hint: (.2 + .4) x 10 != 6