Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@Fast-Nop I wonder if there's an optimization method to transform loops that count up into loops that count down.
You'd need to check data dependencies inside the loop body before transforming, hmm
Maybe via TMP, or by hacking at libclang
Hmm, gotta try this out -
netnut266y0 is the smallest positive integer and combinations of the digits 0-9 make up all other numbers. The first 10 digits are therefore 0-9 and not 1-10, memes or not.
-
TRex10386yIt's a grey area, finding length of array is for developers, where as languages are create for interaction with machine,in this case counting from zero is more practical (might i say needed) when you take into account how memory allocations are done or machine code works. You've to consider binary implementation and memory offsets. For machines counting start from one, we can do nothing to change that even if you hate those memes, counting start from zero
-
geaz2936yI really hope you start counting from zero....otherwise....at least I couldn't say "Zero Fucks Given!"
-
HughRant5086y@netnut @irene
”All non-negative numbers” includes all positive numbers including zero. That shouldn’t be cunfused with ”zero is a positive number” though.
However, a quick google did yield that, in some advance cases, there seem to exist a need to restrict the property of zero to be either negative or positive.
I'm fed up with those memes about programmers that starts counting from 0.
index != count
Just go check in any programming languages.
For example, in Java:
string[] array = new string[1];
array.length doesn't give 0, it gives 1, even if 0 is actually the index of the item.
If you do array[0] you get the position of the item but you don't actually count from zero like that without looking retarded.
Fuck it.
rant
index != count