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

/tech/ - Technology

July 2018 Transparency Report
Name
Email
Subject
Comment *
File
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Flag
Oekaki
Show oekaki applet
(replaces files and can be used instead)
Options
Password (For file and post deletion.)

Allowed file types:jpg, jpeg, gif, png, webm, mp4, pdf
Max filesize is 16 MB.
Max image dimensions are 15000 x 15000.
You may upload 3 per post.


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

 No.867667

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

File: 0ac9a67795a0ff8⋯.jpg (67.72 KB, 763x841, 763:841, 0ac9a67795a0ff8d2b931bbab3….jpg)

>>867667

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

>>867671

usize by default then?


 No.867676

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


 No.867678

>>867667

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

>>867671

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


 No.867700

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

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


 No.867704

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

>>867671

>>867697

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


 No.867715

>>867678

That statement offends my CoC.


 No.867716

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

>>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

Daily reminder FORTH users don't have these problems.

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


 No.867804

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

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

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

Nice try, off-by-one-Satan.


 No.867966

>>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

>>867667

>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

>>868019

low memory is for double niggers.


 No.868153

>>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][Nerve Center][Cancer][Post a Reply]
Delete Post [ ]
[]
[ / / / / / / / / / / / / / ] [ dir / agatha / animu / ausneets / bestemma / gdp2083 / hikki / radcorp ]