Author: Narayan Loke
-
Build Your Own std::vector in C
Over the years of working with C, I often found myself stuck when dealing with dynamically resizable data structures. More often than not, I’d end up allocating a huge fixed-size array which worked at first but soon became a pain to maintain. Tracking index positions, avoiding segmentation faults, and ensuring I wasn’t accessing non-existent memory…
-
Why 0.3 Is Not Exactly 0.3: Understanding Floating-Point Precision in Programming
If you’ve ever written code like this: …and wondered why the “obvious” answer fails? Welcome to the fascinating (and sometimes infuriating) world of floating-point numbers. The Invisible Problem At first glance, 0.1 + 0.2 should be 0.3. Simple, right? But computers don’t store decimal numbers in base 10—they store them in binary, as a sequence…
-
Book Review: The Locked Door by Frieda McFadden
The book is about a doctor who works at a reputed hospital and is haunted by her past, whose father was a serial killer, probably also a doctor, who carried out experiments on his victims behind the so-called “Locked Door.” The idea of the locked door is intriguing in the first few chapters, but the…
-
Book Review: The Silent Patient by Alex Michaelides
Alex Michaelides’ The Silent Patient has been one of the most talked-about psychological thrillers in recent years, and for good reason. The novel blends mystery, psychology, and art into a gripping tale that keeps readers turning the pages, even if they may spot the twist earlier than expected. The Premise At the heart of the…