Author Archives: hurchalla
[C/C++] Surprises and Undefined Behavior From Unsigned Integer Promotion
Consider this code: Figure 1 When you run it you’ll get the output Here’s a link to it on wandbox if you want to try it out. For clarity, there’s no undefined behavior in the program and the compiler isn’t … Continue reading
Implementing the Extended Euclidean Algorithm with Unsigned Inputs
As the previous post showed, it’s possible to correctly implement the Extended Euclidean Algorithm using one signed integral type for all input parameters, intermediate variables, and output variables. None of the calculations will overflow. The implementation was given as follows: … Continue reading
Proof of Bounds for the Extended Euclidean Algorithm
Euclid’s method is a classic algorithm for finding the greatest common divisor (gcd) of two integers. Donald Knuth referred to it as “the granddaddy of all algorithms, because it is the oldest nontrivial algorithm that has survived to the present … Continue reading
Exhaustive Testing (And Certainty)
Exhaustive testing is the idea of testing every single possible combination of inputs to a function. It’s great if you can do it, but there’s a related idea we need to discuss alongside it. The idea is certainty in testing … Continue reading
Google Test Projects in Visual Studio
This is a continuation of the blog entry on a quick start guide to setting up Google Test, this time specific to Visual Studio. First Things First If you used the quick start guide to set up Google Test, you … Continue reading
Quick Start Guide to Setting Up Google Test
There are a few different ways that you can get Google Test and then set it up to begin using it. The Google Test documentation skims a bit over the basic starting steps, then presents perhaps a choice overload for … Continue reading