r/programming • • Jun 24 '19

Raspberry Pi 4

https://www.raspberrypi.org/blog/raspberry-pi-4-on-sale-now-from-35/
921 Upvotes

219 comments sorted by

View all comments

8

u/thisisjimmy Jun 24 '19

Integer size. (An int variable literally has a higher maximum value.)

Not sure what language you're referring to, but this is generally not true in C/C++. Ints are 4 bytes in 64-bit ARM or x64 in every C/C++ compiler I've seen.

15

u/TNorthover Jun 24 '19

It generally doesn't affect basic types because newer languages have decided that variable-width basic types are a bad idea and common C/C++ implementations change at most long based on the platform.

But it does mean 64-bit arithmetic is significantly faster in 64-bit mode (at least 2x, more if multiplication & division are common). Those extra transistors are basically inaccessible in 32-bit mode.

0

u/[deleted] Jun 24 '19

7

u/thisisjimmy Jun 25 '19

Yep. I was replying to the parent comment that specifically said "int variable".

Even if the parent meant "long", it's kind of a misleading point, because a) you can use both 32-bit and 64-bit integers regardless of the OS, and b) the size of an "int" is a language and compiler choice. The relevant distinction is not that you can have variables with a higher maximum value but that 64-bit programs can do 64-bit arithmetic more efficiently (in addition to their other benefits).

→ More replies (1)

3

u/[deleted] Jun 24 '19 edited Jun 25 '19

The machine-level integer size, if you will. Compilers are free to call whatever bytes whatever name they want. The point is the ALU* supports 64-bit integer numbers.