[ / / / / / / / / / / / / / ] [ dir / agatha / animu / ausneets / bestemma / gdp2083 / hikki / radcorp ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Name
Email
Subject
Comment *
File
Select/drop/paste files here
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

File (hide): 4d74e50ff533028⋯.jpg (78.7 KB, 640x406, 320:203, shorts.jpg) (h) (u)

[–]

 No.867667>>867671 >>867678 >>867963 >>867964 >>868019 [Watch Thread][Show All Posts]

Why do you use Int for numbers in your programs? Shouldn't you be using short? Are you really calculating and working with numbers higher than 32787 (or 65535 unsigned)? Unless you are, you should use shorts. Why aren't you using shorts? Shorts are great. Shorts are love. Shorts are life!

S H O R T S

H

O

R

T

S

 No.867671>>867673 >>867697 >>867704

>>867667 (OP)

It takes more cycles to perform the bitshift from the CPU's native datatype. Kill yourself, or come back when you graduate CS101, kiddo.


 No.867673>>867956

>>867671

usize by default then?


 No.867676

But that's just the minimum required size for ints.


 No.867678>>867681 >>867715

>>867667 (OP)

Because chicks dig longs.


 No.867681

>>867678

chad uses longs for everything.


 No.867696

Why did you make the same thread in halfchan?


 No.867697>>867704

>>867671

It doesn't, though. We're not using Alpha shit anymore, grandpa.


 No.867700>>867716

File (hide): e54cd5d1dbb38f3⋯.jpg (1.27 MB, 2400x2857, 2400:2857, aim-for-the-dubs.jpg) (h) (u)

Remember to not try to store your long long in short shorts.


 No.867704

File (hide): 51be66fac9dced9⋯.png (257.55 KB, 1052x1348, 263:337, 68k-000001.png) (h) (u)

>>867671

>>867697

Maybe he's using a real computer like pic-related.


 No.867715

>>867678

That statement offends my CoC.


 No.867716>>868091

File (hide): ff3b152a35db5e4⋯.jpg (25.64 KB, 452x319, 452:319, 1439786483565.jpg) (h) (u)

>>867700

nice long doubles


 No.867725

all joking aside, 32-bit float and integer operations easily outperform 64-bit operations -- by a factor of 2. CPU literally does half the work.

If you're doing a bunch of work with a bunch of numbers, consider early how much precision you need.

dunno if this applies to shorts though. maybe if OP's picture were more to my tastes.


 No.867785>>867966

Daily reminder FORTH users don't have these problems.

https://www.youtube.com/watch?v=LJoRyxRcj4A


 No.867804>>867947 >>867966

everyone ITT is LARPing because the proper way to use integers for speed in C is to use a "fast" integer instead of fixed size. and if you're using any other PL, you really shouldn't be pretending to care about speed of arithmetic. if you're using an assembler, you aren't using retard words like "long", "short", etc


 No.867944

I'm sorry did you just ASSUME the bit-width of short and int on my machine?!?! I really hope nobody here actually uses integral data types other than char, size_t/ssize_t, and stdint types. Jeez


 No.867947

>>867804

>C…

>and if you're using any other PL, you really shouldn't be pretending to care about speed of arithmetic

>any other PL

like C++ or Rust, for example?


 No.867956

>>867673

uintptr_t


 No.867963

>>867667 (OP)

You do realize that anything shorter than an

int
is promoted to
int
anyway whenever actually used? You do realize that
'\0'
or
'a'
are of type
int
in C?
short
s are only really useful if you're literaly short on memory where you store them (such as embedded etc.).


 No.867964

>>867667 (OP)

>he doesn't do real-mode DOS programming where int equals short

Nice try, off-by-one-Satan.


 No.867966>>867982

>>867804

Speed is not the only possible problem, there's also memory. Sometimes you don't care much about speed but need to fit small memory. Also >>867785


 No.867982

>>867966

Computing almost always involves a trade-off between being processing and memory. For instance in the 90s, when CPUs were too weak to render cutscenes in realtime or decode compressed audio formats in a game but the new CD-ROM medium offered much space, you had most of the CD's space filled with pre-rendered cutscenes and/or CD audio music. You traded memory to save on processing. Later when CPUs were more powerful, they rendered cutscenes and decoded compressed audio in realtime, and the space on the CDs was devoted to other games assets so the games themselves could be bigger. You traded processing to regain memory (in the form of space on the CD) for other purposes. That's just one example, but decisions about tradeoffs like these need to be made quite often (not as much as it used to be the case, but in situations like embedded sofware where both processing power and available memory is short, it's still very important).


 No.868019>>868060 >>868120 >>868164

>>867667 (OP)

>tfw mostly using u8

why the fuck would i waste my memory?


 No.868060

>>868019

>u8

At least use the standard uint8_t


 No.868091

>>867716

>long doubles

>not double doubles

Ya blew it.


 No.868110

long long cock = deep_in_ops_ass();


 No.868120>>868153

>>868019

low memory is for double niggers.


 No.868153>>868412

>>868120

Ya done goofed. Double uses the most memory.


 No.868164

>>868019

>anon's program conserves memory like a cuck

>now chadfox has more memory to leak


 No.868412

>>868153

Any float is implicitly promoted to double anyway, and floats only have a 24 bit mantissa (about 7 decimal significant figures) which leads to rounding errors accumulating pretty fast. It's for good reasons that int and double are default types and anything shorter needs to be used explicitly by someone who knows what and why he's doing.




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
29 replies | 4 images | Page ???
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / agatha / animu / ausneets / bestemma / gdp2083 / hikki / radcorp ][ watchlist ]