nowfound

Life & fun · May 22, 2024

Rational numbers for Java, why not?

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.

Rational numbers for Java, why not? launched on May 22, 2024 with 6 votes, #1,748 of 4,539 launches that month and more than 50% of that year's launches. The site was still online in September 2026, 2 years on.

What it does

Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more. - manifold/manifold-deps-parent/manifold-science at master · manifold-systems/manifold

Does a similar job

all alternatives →
  • IW
    I Wrote a Book on Java2024 · ▲586

    https://www.manning.com/books/data-oriented-programming-in-j... This book is a distillation of everything I’ve learned about what effective development looks like in Java (so far!). It's about how to organize programs around data "as plain data" and the surprisingly benefits that emerge when we do. Programs that are built around the data they manage tend to be simpler, smaller, and significantly easier understand. Java has changed radically over the last several years. It has picked up all kinds of new language features which support data oriented programming (records,…

  • IW
    I wished for a site with a growing list of math problems, I built it2024 · teachyourselfmath.app · ▲384

    Good math problems are hidden inside textbooks and online documents. To keep up with all the sources in the world is hard. For someone who just wants to continuously solve problems, finding and going through all the sources feels like a hassle. I wished for a website that could just dump all the math problems available in the world out there. And if I could filter the problems by topics, that would be beautiful. teachyourselfmath is a side project that was born out of this need. At its core, it is a math PDF extraction engine. The engine has some machine learning going on behind the scenes…

  • Floating point arithmetic types in C++ for any size and any base2024 · github.com · ▲79

    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.

  • AD
    All desktop software calculators are wrong, so I had to build my own2022 · ▲286

    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…

  • I made a rational object for javascript2012 · github.com · ▲13

    Rational numbers for Javascript. Contribute to LarryBattle/Ratio.js development by creating an account on GitHub.

  • IG
    I Got Tired of Calculator Sites, So I Built My Own2025 · ▲58

    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…

More life & fun this month

the category →

Source: Show HN post ↗

Launched alongside, May 2024

the whole month →
  • Voicenotes▲1,485

    AI note-taker that's truly intelligent

    AI · 2024 · voicenotes.com

  • Wegic▲1,179

    The first AI web designer & developer by your side

    Dev tools · 2024 · wegic.ai

  • Insighto▲1,108

    Ship features users want

    Growth · 2024 · insigh.to

  • Ivee▲1,087

    The B2B influencer marketing platform

    Growth · 2024

  • Waxwing▲1,035

    AI copilot for every marketing task

    AI · 2024

  • AI powered zero-waste meal planner

    AI · 2024 · ohapotato.app