Why was the space character not chosen for C++14 digit separators?

There is a previous paper, n3499, which tell us that although Bjarne himself suggested spaces as separators: While this approach is consistent with one common typeographic style, it suffers from some compatibility problems. It does not match the syntax for a pp-number, and would minimally require extending that syntax. More importantly, there would be some … Read more

Finding the length of an integer in C

C: Why not just take the base-10 log of the absolute value of the number, round it down, and add one? This works for positive and negative numbers that aren’t 0, and avoids having to use any string conversion functions. The log10, abs, and floor functions are provided by math.h. For example: int nDigits = … Read more