New answers tagged

2 votes

Simple stack of integers

You’re Throwing Away the Top of the Stack You increment or decrement your function parameter named top, but that’s just a local temporary variable inside the ...
  • 2,781
2 votes

Simple stack of integers

Can I resort to reserving INT_MIN for this? Yes. Is this a 'good practice', have unwanted consequences etc? Not good. This is a poor practice. The obvious ...
3 votes

Simple stack of integers

This is a classic example of in-band error signalling, and it's not a good idea (I think you suspect this, having asked about it). You need to separate the data from the error/success status of the ...
  • 55.3k
1 vote

Generic Integer Square Root

how one could solve that problem .... (add support for types that are larger than 128 bits) Found magic number 1257966796 in Implementation of binary floating-point arithmetic on embedded integer ...
1 vote

128-bit integer type in GCC/Clang

I don't believe it's necessary to duplicate the the diagnostic pragma sequence. Just ignore those diagnostics once at the beginning of the #if block and pop the ...
  • 65.4k

Top 50 recent answers are included