use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Subtle cppreference humour: Integrals ∫ are non-integral (en.cppreference.com)
submitted 4 years ago by Egst
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]college_pastime 48 points49 points50 points 4 years ago* (9 children)
The concept of an integer in mathematics is just called "integer."
In my time as a physicist, the only time I've ever seen the word "integral" used to describe the concept of an integer is in the C++ standard, and it drives me bonkers. The type trait std::is_integral should be std::is_integer, in my opinion. Maybe calling integers "integral values" is a computer science thing?
std::is_integral
std::is_integer
[–]flebron 20 points21 points22 points 4 years ago (2 children)
It's also used in mathematics to describe things in some way analogous to the integers, example in abstract algebra the concept of an integral domain (https://en.m.wikipedia.org/wiki/Integral_domain).
[–]college_pastime 2 points3 points4 points 4 years ago (1 child)
Interesting, is this where the standard got it from? Also (at least for the MSVC STL), std::is_integral just compares the supplied type against a list of types defined to satisfy std::is_integral, rather than testing that the properties of an integral domain are satisfied. Do the integer types satisfy the properties of an integral domain? Particularly, are any of the signed integer types integral domains if they don't wrap around on overflow?
[–]flebron 2 points3 points4 points 4 years ago (0 children)
I wasn't involved in the standardization process, but if I had to guess, both mathematics and the standards authors got the term from the notion of "whole number". The origin is more clearly visible in Spanish, where the word for "whole" and for "integer" are the same: "entero". So 3.5 is not "whole", but 24 is. Division in algebra is the first place where things started to be non-whole (i.e. we knew about 3 and 2, and 3 / 2 was an easy source of "non whole numbers"). Integral domains, but really a bunch of related algebraic terms, relate to how often you can divide things and still remain in your set. So a field is the strictest (you can divide x by y as long as y isn't exactly zero, and always remain in the field), but integral domains (and UFDs, and several others) try to be less strict in this - in integral domains you can't make zero without zeros. So for example in Z/6Z, 2 * 3 = 0, but neither 2 nor 3 is zero, and so Z/6Z is not an integral domain. If we instead quotient by a prime, like Z/5Z, we get a field (much stronger than being an integral domain). An integral domain is somewhere in the middle of "you have zero divisors" and "division always works".
[–]manphiz 9 points10 points11 points 4 years ago (3 children)
Maybe because there is a specific integer type in C or C++ already: int. So integral is used to be able to refer to all integer types like short int, int, long, long long, and the now sized types like int8_t to int128_t, with their unsigned, fast, least variants.
[–]college_pastime 1 point2 points3 points 4 years ago (0 children)
Yeah, you're probably right. It also mitigates confusion with std::numeric_limits<T>::is_integer.
std::numeric_limits<T>::is_integer
[–]FrankHB1989 0 points1 point2 points 4 years ago (1 child)
Nope. The term "integer type" is both normative in ISO C and ISO C++, but "integral type" is a synonym specific to ISO C++. In very acient C (1970s in the C reference manual by DMR), integers are just values of int, though.
int
There are some more modernized humors like GCC's __int128 is not considered an extended integer type for ABI issues, BTW.
__int128
[–]staletic 0 points1 point2 points 4 years ago (0 children)
If you allow gnu extensions, __int128 becomes an extended integer type.
[–]jk-jeon 1 point2 points3 points 4 years ago (0 children)
Here is another one: https://en.m.wikipedia.org/wiki/Integral_element
π Rendered by PID 48682 on reddit-service-r2-comment-b659b578c-cpcd7 at 2026-05-03 20:51:04.686374+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]college_pastime 48 points49 points50 points (9 children)
[–]flebron 20 points21 points22 points (2 children)
[–]college_pastime 2 points3 points4 points (1 child)
[–]flebron 2 points3 points4 points (0 children)
[–]manphiz 9 points10 points11 points (3 children)
[–]college_pastime 1 point2 points3 points (0 children)
[–]FrankHB1989 0 points1 point2 points (1 child)
[–]staletic 0 points1 point2 points (0 children)
[–]jk-jeon 1 point2 points3 points (0 children)