- Portals
- The Current Year
- ED in the News
- Admins
- Help ED Rebuild
- Archive
- ED Bookmarklet
- Donate Bitcoin
Contact an admin on Discord or EDF if you want an account. Also fuck bots.
Integer: Difference between revisions
imported>Hellrazor No edit summary |
imported>Hellrazor No edit summary |
||
Line 4: | Line 4: | ||
'''tl;dr:''' You can use Integers to save whole numbers. Inserting a float value like 0.5 will result in 0 when stored as an integer. Rounding and floor/ceiling instances will vary. Check with your local integer provider for [[moar]] options. Nobody seems to know just how large an integer in memory, with sizes ranging from two to eight bytes in size depending on operating system, processor architecture and what size shoe you wear. | '''tl;dr:''' You can use Integers to save whole numbers. Inserting a float value like 0.5 will result in 0 when stored as an integer. Rounding and floor/ceiling instances will vary. Check with your local integer provider for [[moar]] options. Nobody seems to know just how large an integer in memory, with sizes ranging from two to eight bytes in size depending on operating system, processor architecture and what size shoe you wear. | ||
Integers can be [[over 9000]], but not bigger than 2^63 (unless | Integers can be [[over 9000]], but not bigger than 2^63 (unless it's unsigned, which means it can be up to 2^64-1 - use your noodle and look up the order of operations). Using Integers the wrong way can result in [[lulz|bugs]] in software. Using MAX_INT can be used to fuck up bad websites. | ||
Note: Sometimes integers can be bad. For instance, trying to round pi to three could result in not a circle, but a tightly-wound spiral. | Note: Sometimes integers can be bad. For instance, trying to round pi to three could result in not a circle, but a tightly-wound spiral. |
Revision as of 21:19, 3 February 2014
Integer is part of a series on Programming. [Enter the Matrix] | |
ADA • Assembly • C • C++ • COBOL • Debug • DOS • Erlang • Error • Fdisk • Fortran • Integer • Java • LOLCode • Machine Code • Matlab • MIRC Script • MUMPS • Open Source • Perl • PHP • Programming language • Python • QBASIC • Ruby on Rails • Scratch • SSH • Visual Basic
Firefox XPS IRC Attack • Safari XPS Attack • Sandworm
Bill Gates • Linus Torvalds • Weev • Goatse Security • Terry Davis • Theo de Raadt
Operating system • Warez • Notepad • Is not a bug, it's a feature • Database Error |
tl;dr: You can use Integers to save whole numbers. Inserting a float value like 0.5 will result in 0 when stored as an integer. Rounding and floor/ceiling instances will vary. Check with your local integer provider for moar options. Nobody seems to know just how large an integer in memory, with sizes ranging from two to eight bytes in size depending on operating system, processor architecture and what size shoe you wear.
Integers can be over 9000, but not bigger than 2^63 (unless it's unsigned, which means it can be up to 2^64-1 - use your noodle and look up the order of operations). Using Integers the wrong way can result in bugs in software. Using MAX_INT can be used to fuck up bad websites.
Note: Sometimes integers can be bad. For instance, trying to round pi to three could result in not a circle, but a tightly-wound spiral.
Examples of Float to Integer conversion:
Number | Result | Comment |
Over 9000 | Over 9000 | Great power level, but don't use as a power of a number bigger than 1. |
15.9 | 15 | But she was almost 16. |
15.9 | 16 | 16 in the state of Florida for great justice |
13.0 | 49 | That's not a 13-year old you are chatting with |
17.9 | 17 | childporn? But she was almost 18. |
17.9 | 18 | childporn? It looks like an adults vagina, so it's not CP |
1/2 | 0 | Dividing primes is a bad idea. |
1/0 | Oh shi- | You can't divide by zero you idiot. |