[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Off-by-one coding errors
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 17
Thread images: 3
File: image.jpg (53 KB, 600x350) Image search: [Google]
image.jpg
53 KB, 600x350
How often do these get you?

Why can't computers just count up from 1 like people? 0 isn't even a number. If it was, we'd have 11 fingers.

Don't trust me near your arrays or offsets. I always get them wrong.
>>
Plenty of algorithms wouldn't even work if your array indices started from 1.
>>
Not that often, since I'm used to 0 indexed arrays. But you can always use Fortan, OP.
>>
>the current year
>not using for each loops
>>
>>55106922
>0 isn't even a number. If it was, we'd have 11 fingers.
Good bait
>>
>>55106950
I sometimes embed obvious bait in my posts to get free bumps.

Idiots will either take the bait or think they cleverly saw through my rouse and say "nice bait", which help keep my thread alive. While anyone who has a brain or useful input will just ignore it and add to the topic.

It's a system that's been working quite well for me. I'm glad you enjoyed being a part of it.
>>
>>55107006
(You)
>>
>>55106922
ur a faggot
sage is 4 u
>>
File: fence.png (9 KB, 598x142) Image search: [Google]
fence.png
9 KB, 598x142
>>55106922
>Why can't computers just count up from 1 like people?
https://en.wikipedia.org/wiki/Edsger_W._Dijkstra

https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html

https://en.wikipedia.org/wiki/Zero-based_numbering

tl;dr They can, but starting from zero is good for many reasons.
>>
>>55106922
But we INDEX starting from zero.

The first hour in a day is 12:00 (=0 mod 12) to 12:59, not 1 to 1:59

The first century is 001 to 099, not 100-199.

By ignoring 0, you are stupider than the humans 1500 years ago who invented it. The discovery of zero is one of humanity's milestone achievements.
>>
>>55107006
>underrated post
>>
>>55106922
>Why can't computers just count up from 1 like people? 0 isn't even a number. If it was, we'd have 11 fingers.

Wow, and people get mad at me when I say computer science majors (not that you are one) are clinically retarded.
>>
>>55106922
>the programming language i use doesn't support the definition of the array start index
nigga, even on pascal you can define an array to be [3..69]
stop using baby-shit programming languages
>>
>>55107006
You'd succeed on tinder m8
>>
>>55106922
Reminds me of a korean friend of mine, who told me in korea the age counter starts from 1 instead of 0. When you're born, you're 1. When she goes back to korea she's 1 year older.
>>
I get off by one errors all the time. I just happen to know how to use software debugging tools to find out what I need to know.
>>
File: 1425179839548.png (821 KB, 865x807) Image search: [Google]
1425179839548.png
821 KB, 865x807
>>55106922
>0 isn't even a number. If it was, we'd have 11 fingers.
If 0 was a number we'd have 9 fingers.
Thread replies: 17
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.