nowfound

Life & fun · alternatives · 2026

24 alternatives to Floating point arithmetic types in C++ for any size and any base

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.

This is a C++ library implementing floating point arithmetic types that support arbitrary sizes and number bases. It was created as a learning project to explore how floating point numbers work and to develop C++… Below are 24 products that do a similar job, ranked by how close each is in meaning and then by launch-day votes. Floating point arithmetic types in C++ for any size and any base launched in 2024; newer entries below may have overtaken it.

  1. 1

    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 · its alternatives →

  2. 2

    A mirror of https://git.sr.ht/~grego/sumtypes.h. Contribute to grego/sumtype.h development by creating an account on GitHub.

    2024 · github.com · its alternatives →

  3. 3

    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 · its alternatives →

  4. 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 · its alternatives →

  5. 5AD

    A new calculator software cannot really bring attention (https://chachatelier.fr/chalk/) However, I wrote a full article explaining why I had to build something "new" that does not behave like usual desktop calculator softwares : TL;DR All "small" calculator softwares I know share the same design flaws. And the GUI is not the only stumbling block in their poor efficiency. Handling correctly numerical approximations - expected or not - is crucial to trust the results. It is usually not done in lightweight tools. It should. So I prove that if I could do it, OS manufacturers…

    2022 · its alternatives →

  6. 6

    🧮 Small library for big decimal numbers. Contribute to bpierre/dnum development by creating an account on GitHub.

    2023 · github.com · its alternatives →

  7. 7

    Simple Qt-based programming calculator. Contribute to fellerts/procal development by creating an account on GitHub.

    2023 · github.com · its alternatives →

  8. 8HT

    Basically wrap your data struct in Option>> Better yet, use your custom type that provides few helper functions that make using it as nice as old C++ pointers. Obviously there's no pointer arithmetic, but it works great for dynamically allocated structures like trees or linked lists. Please comment how it's a horrible idea that will bring doom to me and my family. fn main() { struct Data { pub number: i32 } // struct Data { int number; }; let mut p:Pointer = Pointer(None); // Data *p = NULL; println!("{}", p.is_none()); // printf(p == NULL ? "true\n" :…

    2022 · its alternatives →

  9. 9

    A minimal viable programming language on top of liblgpp - codr7/alang

    2021 · github.com · its alternatives →

  10. 10

    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 · its alternatives →

  11. 11

    Geometry library for C - Fast point-in-polygon. Contribute to tidwall/tg development by creating an account on GitHub.

    2023 · github.com · its alternatives →

  12. 12

    Advanced Mathematics Library for Node.js and JavaScript - numbers/numbers.js

    2012 · github.com · its alternatives →

  13. 13IB

    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…

    2025 · its alternatives →

  14. 14AA

    Hey everyone! I'm Rob and I want to share what I've built - a solid ledger behind simple API: https://decimals.app The ledger is a key piece of any financial system and is easy to get the design wrong, resulting in troubles for making sure money movements are adding up. I took a lot of inspiration from good designs from Square, Uber, and others for the scalability and security aspects. And on the usability side, I applied many concepts from the Ledger CLI, making it very easy to use. I'm really happy I get to show this to you all, thank you for reading about it! Please let me know…

    2020 · its alternatives →

  15. 15

    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 · its alternatives →

  16. 16

    A C++ library for debugging purposes that can print any variable, even user-defined types. - philip82148/cpp-dump

    2023 · github.com · its alternatives →

  17. 17BA
  18. 18

    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 · its alternatives →

  19. 19

    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 · its alternatives →

  20. 20IG

    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 · its alternatives →

  21. 21

    Develop your programming skills or start your coding journey

    2021 · play.google.com · its alternatives →

  22. 22

    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 · its alternatives →

  23. 23

    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 · its alternatives →

  24. 24

    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…

    2025 · cppstat.dev · its alternatives →

Also compare

Ranked by how close each launch is in meaning, then by votes. Prices were read from each product’s own site when checked and can change. Refine with your own description →