Skip to main content

Timeline for Tips for golfing in C++

Current License: CC BY-SA 3.0

9 events
when toggle format what by license comment
Feb 7, 2020 at 9:55 comment added Baldrickk @S.S.Anne the point is you can use x*y saving a character.
Jul 24, 2019 at 11:03 comment added Baldrickk @celtschk yes, good point. But if you're purely doing the boolean algebra, then it works
Jul 17, 2019 at 20:29 comment added celtschk Note however that && has a short-circuit behaviour which * lacks. For example, you can't replace i++!=0&&j++!=0 with i++*j++.
Aug 4, 2016 at 7:52 history edited Baldrickk CC BY-SA 3.0
deleted 10 characters in body
Feb 20, 2015 at 2:49 history wiki removed Doorknob
Sep 11, 2014 at 11:37 history edited Baldrickk CC BY-SA 3.0
added 77 characters in body
Sep 11, 2014 at 11:33 comment added Baldrickk Yes, that's right. I used it as a twodimensional array bounds check here: codegolf.stackexchange.com/a/37571/31477 where that didn't matter. I'll edit those points in.
Sep 11, 2014 at 11:15 comment added Martin Ender Technically, it's x!=0 && y!=0. But when using multiplication you need to be careful with overflows. When using 32-bit integers x = y = 65536 (and several other combinations of powers of two) would also yield x*y = 0.
Sep 11, 2014 at 11:07 history answered Baldrickk CC BY-SA 3.0