The solution this month’s Exercise isn’t that complex, but it was handy in disproving a theory.
Continue reading
Author Archives: dgookin
Digits of Significance
In last week’s Lesson, I lamented that C lacks a function to compare two floating point values based on a significant number of digits. Being a C programmer, I resolved this issue by writing a function that accomplishes this suddenly necessary task.
Continue reading
Multiples of Four
I enjoy playing number games. I’m not good at it, but I enjoy playing them. Recently such a game piqued my curiosity enough to consider it for my monthly C For Dummies exercise: 21
Continue reading
My Own Square Root Funtion
From last week’s Lesson, I plowed into a BASIC programming book I worked on 35 years ago. (Yes, I’m old.) In it, substitute code was offered for commands not available in every version of BASIC. To appreciate this necessity, understand that back in those days computers weren’t file-to-file compatible, so translating programming language dialects was part of the job.
Continue reading
Getting to the Square Root of the Problem
The first part of my writing career began by updating a computer book bestseller, The BASIC Handbook. This tome served as a lexicon for the various BASIC programming language dialects, allowing users from one version of BASIC to translate and use code from another version.
Continue reading
The gettimeofday() Function
Every so often I scour C library references, looking for fun or unusual functions. When I find one I’m unfamiliar with or something I’ve seldom used, I write about. After all, the functions do practical things that might be worthy of exploration. A recent example is gettimeofday().
Continue reading
Nested Processing – Solution
This month’s Exercise wasn’t astronomically difficult, but I did spend some time devising a solution. My goal was to try to avoid writing a nested loop. This goal proved unattainable.
Continue reading
What Size Integer?
Things were stable back in the old days. When I first coded C, a char was 8-bits (a byte), and an int was 16-bits. The short was also 16-bits and the long, it was truly long at 32-bits. Today, things aren’t as consistent.
Continue reading
Nested Processing
After a few intermediate to advanced Exercises, I decided to try something that’s a little easier this month. Still, even if you’re a pro, it helps to pull back and try something basic just to see what you can do with it.
Continue reading
I/O in [Almost] Any Base
After climbing the ternary I/O mountain, and crafting functions that both input and output base 3 values, the next step is obvious: Combine both functions into a single program. The step after that is less obvious: Change the code so that any base can be used to process input or generate output.
Continue reading