I think it is setting _a to half of itself. /= is a "divide by and set" operator. So the joke is it is setting itself to itself divided by one, which should be the same. But if _a is an INT or something, then the 1.0 would actually be [if the interpeter is sophisticated] setting itself to the same value with a different type.
I know the joke. It's always _a. Hence another dude commented the 11 bytes he just wrote could be 0, because the whole line is a waste of a calculation cycle. Any number divided by 1 is itself.
edit: some people prefer to name variables with a _ in front of it. Just depends which asshole taught you programming.
16 comments
0 u/Morbo 21 Feb 2018 23:50
I think you just found 11 bytes of code you could shrink down to 0 bytes.
0 u/drumy 22 Feb 2018 05:58
That's infinite compression, you should publish a paper on it.
0 u/dellcos 15 Mar 2018 13:18
Isn't there a word for that? "Deletion" maybe?
0 u/MHole 22 Feb 2018 00:02
What language? I don't understand? Is it setting a constant to a decimal value of itself maybe instead of a float or a single digit?
I don't know this language I don't think so I don't know what is special about underscore a.
0 u/Cooking_with_Alf 22 Feb 2018 00:10
_a can be a variable name. /= is what I don't understand. 1.0 is obviously a double.
0 u/MHole 22 Feb 2018 00:12
I think it is setting _a to half of itself. /= is a "divide by and set" operator. So the joke is it is setting itself to itself divided by one, which should be the same. But if _a is an INT or something, then the 1.0 would actually be [if the interpeter is sophisticated] setting itself to the same value with a different type.
But I don't know why _a is special.
0 u/SChalice [OP] 22 Feb 2018 00:17
float _a
0 u/MHole 22 Feb 2018 00:28
Thanks. You could be David Bowie in this;
https://www.hooktube.com/watch?time_continue=6&v=BNDnzxlBoS4
1 u/Cooking_with_Alf 22 Feb 2018 00:22
I know the joke. It's always _a. Hence another dude commented the 11 bytes he just wrote could be 0, because the whole line is a waste of a calculation cycle. Any number divided by 1 is itself.
edit: some people prefer to name variables with a _ in front of it. Just depends which asshole taught you programming.
0 u/avgwhtguy1 22 Feb 2018 02:18
placeholder
0 u/drumy 22 Feb 2018 05:59
for a future empty line
0 u/BakedMofoBread 22 Feb 2018 02:22
I dunno, maybe they overloaded the division operator. Overloading / will affect /=
0 u/goalltheway 24 Feb 2018 11:20
underrated comment otherwise it makes no sense
0 u/drumy 22 Feb 2018 06:00
Maybe it's a test of FP unit.
0 u/Myrv 22 Feb 2018 21:11
Any decent compiler should optimize that line away (GCC does at its default optimization level). So while odd, it really shouldn't affect anything.
0 u/roznak 23 Feb 2018 01:37
If this is "_a = _a / 1.0" then "_a" may not have the same value anymore and introduce a very small epsilon error.
If _a=10, then may become _a == 10.0000000001 or _a == 9.99999999987