frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Show HN: I built a tiny LLM to demystify how language models work

https://github.com/arman-bd/guppylm
459•armanified•9h ago•41 comments

France pulls last gold held in US for $15B gain

https://www.mining.com/france-pulls-last-gold-held-in-us-for-15b-gain/
80•teleforce•1h ago•53 comments

Gemma 4 on iPhone

https://apps.apple.com/nl/app/google-ai-edge-gallery/id6749645337
635•janandonly•15h ago•169 comments

Microsoft hasn't had a coherent GUI strategy since Petzold

https://www.jsnover.com/blog/2026/03/13/microsoft-hasnt-had-a-coherent-gui-strategy-since-petzold/
451•naves•16h ago•275 comments

An open-source 240-antenna array to bounce signals off the Moon

https://moonrf.com/
103•hillcrestenigma•6h ago•12 comments

The 1987 game “The Last Ninja” was 40 kilobytes

https://twitter.com/exQUIZitely/status/2040777977521398151
107•keepamovin•6h ago•60 comments

LÖVE: 2D Game Framework for Lua

https://github.com/love2d/love
309•cl3misch•2d ago•126 comments

Show HN: I made a YouTube search form with advanced filters

https://playlists.at/youtube/search/
222•nevernothing•9h ago•135 comments

Show HN: Gemma Gem – AI model embedded in a browser – no API keys, no cloud

https://github.com/kessler/gemma-gem
78•ikessler•9h ago•14 comments

Signals, the push-pull based algorithm

https://willybrauner.com/journal/signal-the-push-pull-based-algorithm
50•mpweiher•2d ago•16 comments

Case study: recovery of a corrupted 12 TB multi-device pool

https://github.com/kdave/btrfs-progs/issues/1107
62•salt4034•7h ago•22 comments

Sheets Spreadsheets in Your Terminal

https://github.com/maaslalani/sheets
78•_____k•2d ago•16 comments

One ant for $220: The new frontier of wildlife trafficking

https://www.bbc.com/news/articles/cg4g44zv37qo
29•gmays•3d ago•0 comments

Show HN: Real-time AI (audio/video in, voice out) on an M3 Pro with Gemma E2B

https://github.com/fikrikarim/parlor
84•karimf•15h ago•5 comments

Why Switzerland has 25 Gbit internet and America doesn't

https://sschueller.github.io/posts/the-free-market-lie/
492•sschueller•15h ago•369 comments

Running Gemma 4 locally with LM Studio's new headless CLI and Claude Code

https://ai.georgeliu.com/p/running-google-gemma-4-locally-with
278•vbtechguy•16h ago•67 comments

Drop, formerly Massdrop, ends most collaborations and rebrands under Corsair

https://drop.com/
18•stevebmark•5h ago•2 comments

Does coding with LLMs mean more microservices?

https://ben.page/microservices
25•jer0me•7h ago•8 comments

Music for Programming

https://musicforprogramming.net
199•merusame•15h ago•83 comments

Show HN: Modo – I built an open-source alternative to Kiro, Cursor, and Windsurf

https://github.com/mohshomis/modo
48•mohshomis•9h ago•10 comments

Employers use your personal data to figure out the lowest salary you'll accept

https://www.marketwatch.com/story/employers-are-using-your-personal-data-to-figure-out-the-lowest...
217•thisislife2•9h ago•116 comments

Usenet Archives

https://usenetarchives.com
48•myth_drannon•8h ago•13 comments

A tail-call interpreter in (nightly) Rust

https://www.mattkeeter.com/blog/2026-04-05-tailcall/
164•g0xA52A2A•18h ago•38 comments

Media scraper Gallery-dl is moving to Codeberg after receiving a DMCA notice

https://github.com/mikf/gallery-dl/discussions/9304
143•MoltenMonster•6h ago•46 comments

Eight years of wanting, three months of building with AI

https://lalitm.com/post/building-syntaqlite-ai/
777•brilee•21h ago•233 comments

Computational Physics (2nd Edition) (2025)

https://websites.umich.edu/~mejn/cp2/
140•teleforce•18h ago•20 comments

Caveman: Why use many token when few token do trick

https://github.com/JuliusBrussee/caveman
764•tosh•1d ago•335 comments

Make your own ColecoVision at home, part 5

https://www.leadedsolder.com/2026/03/24/colecovision-diy-part-5.html
8•classichasclass•6h ago•0 comments

Artemis II crew see first glimpse of far side of Moon [video]

https://www.bbc.com/news/videos/ce3d5gkd2geo
481•mooreds•19h ago•367 comments

Nanocode: The best Claude Code that $200 can buy in pure JAX on TPUs

https://github.com/salmanmohammadi/nanocode/discussions/1
188•desideratum•19h ago•25 comments
Open in hackernews

Comparing floating-point numbers (2012)

https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
26•sph•10mo ago

Comments

LegionMammal978•10mo ago
I'd argue that any equality comparison of floating-point numbers is asking for trouble, unless you're specifically working with small dyadic fractions (using exact comparison) or testing a purely heuristic 'closeness' condition (using fuzzy comparison).

Of course, inequalities show up in a lot more places, but are similarly fraught with difficulty, since mathematical statements may fail to translate to floating-point inequalities. E.g., in computational geometry, people have written entire papers about optimizing correct orientation predicates [0], since the naive method can easily break at small angles. This sort of thing is what often shows up as tiny seams in 3D video-game geometry.

[0] https://www.cs.cmu.edu/~quake/robust.html

mtklein•10mo ago
My preferred way to compare floats as being interchangeably equivalent in unit tests is

    bool equiv(float x, float y) {
        return (x <= y && y <= x)
            || (x != x && y != y);
    }
This handles things like ±0 and NaNs (while NaNs can't be IEEE-754-equal per se, they're almost always interchangeable), and convinces -Wfloat-equal you kinda know what you're doing. Also everything visually lines up real neat and tidy, which I find makes it easy to remember.

Outside unit tests... I haven't really encountered many places where float equality is actually what I want to test. It's usually some < or <= condition instead.

sph•10mo ago
I have built a production Javascript library with decent amounts of users that incorporates the following hack to deal with float error (avert your eyes if you're sensitive):

  // 1.2 - 1.0 === 0.19999999999999996
  // fixFloatError(1.2 - 1.0) === 0.2
  var fixFloatError = function (n) {
    return parseFloat(n.toPrecision(12));
  };
It felt correct at the time, but after reading the article, I cringe at how fundamentally broken it is. I got away with it because the library is used to convert betting odds, which are mostly small floating point numbers, so the error is often < 10^-12.