Alternatives
Products that do what Floating point arithmetic types in C++ for any size and any base does
Since there is so much interest on HN in floats lately and their software implementations, I wanted to show mine. It has no use and is just for teaching me floats and C++. Give me your thoughts.
- 1KMKotlin Money▲427
Manipulating monetary amounts is a common computing chore. However, no mainstream language has a first-class data type for representing money, it’s up to programmers to code abstractions for it. This isn’t an issue per se until dealing with rounding issues from operations like installment payments (e.g., buy now, pay later), foreign exchange, or even simple things like fee processing and tax collection. Inspired by my days at N26 Brasil dealing with these challenges, I introduce Money: a Kotlin library that makes monetary calculations and allocations easy.
2024 · blog.eriksen.com.br
- 2SA
2024 · github.com
- 3FR
Morning HN. Random number generation feels is a somewhat underrepresented topic in the C++ realm. There is a lot of questionable info about it found online and even the standard library is quite behind the times in terms of it's algorithms. It suffers from trying to accommodate sometimes impractical standard requirements and has several ways of getting significantly bad statistical results. This leaves a lot easily achievable performance & quality on the table. So, being a mathematician who mostly works with stochastic models and wants these models to run fast and well, I embarked on a…
2025 · github.com
- 4IM
I've been studying interval arithmetic for the past few weeks and it's a really interesting field because while there is a ton of super interesting research published over the past decades, it has never really gotten the recognition that it deserves, IMO. One reason for this is that standard interval arithmetic has really poor handling of division by intervals containing zero. If you compute 1 / [-1, 2] in regular interval arithmetic, you get either [-∞, +∞], or you have to say that the operation is undefined. Both solutions are virtually useless. The real answer of course is [-∞, -1] U…
Apr 2026 · victorpoughon.github.io
- 5VA
Wrote this to learn more about the `chumsky` parser combinator library, rustyline, and the `ariadne` error reporting crate. Such a nice DX combo for writing new languages. Still a work in progress, but I thought I'd share :)
2025 · github.com
- 6IB
This weekend I created stacklib.h - a single-header library that brings Forth-style stack operations to C. It implements a basic interpreter with: - Stack operations (push/pop/dup/swap/over/drop) - Arithmetic (+, -, *, /) - Output (., emit, cr) - Stack inspection (.s, depth) Example usage: Stack s; stack_init(&s); dict_init(); exec(&s, "10 20 + ."); // Prints "30" exec(&s, "1 2 3 4 .s"); // Shows stack contents The library is self-contained, requires no dependencies, and handles basic error checking. It was inspired by wanting to understand…
Sep 2025
- 7TF
2023 · github.com
- 8RV
I use this library I made for Vectors and Quaternions in many personal projects. I've open-sourced it, in case anyone else would get use out of it. I use this on various projects, including quadcopter firmware, a graphics engine, a cosmology simulation, and several molecular dynamics applications. No_std compatible.
2025 · github.com
- 9DA
2023 · github.com
- 10CA
Hello Hacker News. I’m Martin, a graduate student from Prague, and I’ve been working on Coros, a C++ library for task-based parallelism. After spending some time with OpenMP and oneTBB, I wanted to try building a library using modern features from the C++ standard library. I’ve used coroutines for task encapsulation and C++23 expected for exception handling, while trying to maintain good performance. Additionally, I’ve implemented monadic-like behavior to allow easy chaining of tasks, similar to the monadic operations in std::expected. You can check out the project here:…
2024 · github.com
- 11IM
2025 · github.com
- 12AE
This C library is part of a main project aimed at providing a reactive key-value (KV) database. The data is typed (numbers, strings, dates, or booleans) and can include formulas with references to other entries. Clients connected to this database receive a real-time data stream with updates to the subscribed keys, allowing them to react to changes and their dependencies. Essentially, it’s like building a distributed Excel, where data and formulas dynamically update across the system. I couldn’t find any libraries that offered the full set of features I needed for evaluating expressions, so I…
2024 · github.com
- 13IG
I’ve always found that online calculators tend to have bad UIs, especially on mobile. Most of the calculator websites I’ve come across use outdated and inconvenient ways of inputting data, or they format the results in confusing ways. I’ve noticed that fraction calculators (especially mixed fractions) are terrible to use, even on desktop. I haven’t built one of those yet, but it’s something I’m planning to tackle soon. This is a project I’ve always wanted to work on, but I’m relatively new to this space. So far, I’ve created a collection of simple calculators focused on math and finance. I’d…
2025
- 14AN
The core question: how did HP's scientific calculators actually work at the gate level? That rabbit hole led to building one from scratch. The architectural decision everything else follows from: a decimal calculator should store numbers as BCD — one decimal digit per 4-bit nibble. A standard byte-oriented CPU (Z80, 6502) fights that layout constantly. So I designed a small custom CPU in Verilog where 4 bits is the natural data width and memory is nibble addressable. What the project covers: - Custom CPU: Harvard architecture, 12-bit ISA, 8-state execution FSM, hardware stack guard with a…
May 2026 · github.com
- 15NA
2023 · numbat.dev
- 16CA
Hi HN! I've built [CXXStateTree](https://github.com/ZigRazor/CXXStateTree), a modern C++ header-only library to create hierarchical state machines with clean, intuitive APIs. It supports: - Deeply nested states - Entry/exit handlers - State transitions with guards and actions - Asynchronous transitions with `co_await` (C++20 coroutines) - Optional runtime type identification for flexibility It's ideal for complex control logic, embedded systems, games, robotics, and anywhere you'd use a finite state machine. I’d love feedback, use cases, or contributions from the…
2025 · github.com
- 17BT
Try it on Compiler Explorer: https://godbolt.org/z/91dj5jeGW Check out the source code: https://github.com/RyanJK5/rjk-duck
Jul 2026 · ryanjk5.github.io
- 18RN
A while back I built a science library supporting both physical and abstract dimensions. Almost immediately I discovered working with floating point numbers suck in that space and BigDecimal isn't much better in terms of managing scale wrt margin of error across calculations, Java doesn't make this easy. Rationals are in my view much better suited for science/math in that information cannot be unintentionally lost when using them. So I made a Rational for Java, and in the process _forced_ Java to work better with science and math.
2024 · github.com
- 19AS
Feb 2026 · github.com
- 20CC
Hi HN, I have created a webpage that displays all C++ features since C++20 in a simple, searchable table. It is intended to serve as a quick reference for C++ developers, whether as support for cross-platform development or simply to track the current support status out of curiosity. I created it as a simpler, more structured, and more up-to-date alternative to the cppreference compiler support site. Please note that the page intentionally does not list LWG and CWG papers. This might change as I am continually updating the site and trying out new ideas. Questions, feedback and suggestions…
Sep 2025 · cppstat.dev
- 21IM
I’m 15 and self-taught. I'm learning ML from scratch because I want to really understand how things work. I’m not into frameworks. I prefer math, logic, and C++. I implemented a basic MLP that supports different activation and loss functions. It was trained via mini-batch gradient descent. I wrote it from scratch, using no external libraries except Eigen (for linear algebra). I learned how a Neural Network learns (all the math) -- how the forward pass works, and how learning via backpropagation works. How to convert all that math into code. I’ll write a blog soon explaining how MLPs work in…
2025 · github.com
- 22AC
2023 · github.com
- 23SH
Morning HN. I often found myself wondering "how much does this code segment take in terms of total runtime" and it's often quite annoying to figure out with optimizations enabled, especially when working on something new or testing someone else's implementation without the proper tooling set up. Wanted to have a single include lib that would allow us to write something like: ``` PROFILE("Loop 1") for (...) // some work ``` and have the next expression automatically record time & dump results to a table. Wrote a few macros to do exactly that a few months back, but they were…
2025 · github.com
- 24CL
Sep 2025 · github.com
Ranked by how close each launch is in meaning, then by votes. Refine with a description →