Just found this line of code

2    21 Feb 2018 23:43 by u/SChalice

_a /= 1.0;

Brilliant!

16 comments

0

I think you just found 11 bytes of code you could shrink down to 0 bytes.

0

That's infinite compression, you should publish a paper on it.

0

Isn't there a word for that? "Deletion" maybe?

0

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

_a can be a variable name. /= is what I don't understand. 1.0 is obviously a double.

0

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

float _a

0

Thanks. You could be David Bowie in this;

https://www.hooktube.com/watch?time_continue=6&v=BNDnzxlBoS4

1

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

placeholder

0

for a future empty line

0

I dunno, maybe they overloaded the division operator. Overloading / will affect /=

0

underrated comment otherwise it makes no sense

0

Maybe it's a test of FP unit.

0

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

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