frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

28M Hacker News comments as vector embedding search dataset

https://clickhouse.com/docs/getting-started/example-datasets/hackernews-vector-search-dataset
50•walterbell•43m ago•11 comments

Imgur Geo-Blocked the UK, So I Geo-Unblocked My Network

https://blog.tymscar.com/posts/imgurukproxy/
34•tymscar•29m ago•5 comments

So you wanna build a local RAG?

https://blog.yakkomajuri.com/blog/local-rag
55•pedriquepacheco•1h ago•9 comments

C++ Web Server on my custom hobby OS

https://oshub.org/projects/retros-32/posts/getting-a-webserver-running
30•joexbayer•1h ago•3 comments

Bringing Sexy Back. Internet surveillance has killed eroticism

https://lux-magazine.com/article/privacy-eroticism/
110•eustoria•1h ago•45 comments

Don't tug on that, you never know what it might be attached to (2016)

https://blog.plover.com/2016/07/01/#tmpdir
62•todsacerdoti•2h ago•15 comments

Can Dutch universities do without Microsoft?

https://dub.uu.nl/en/news/can-dutch-universities-do-without-microsoft
141•robtherobber•2h ago•113 comments

JSON Schema Demystified: Dialects, Vocabularies and Metaschemas

https://www.iankduncan.com/engineering/2025-11-24-json-schema-demystified/
18•navigate8310•1h ago•1 comments

True P2P Email on Top of Yggdrasil Network

https://github.com/JB-SelfCompany/Tyr
47•basemi•2h ago•8 comments

Anti-patterns while working with LLMs

https://instavm.io/blog/llm-anti-patterns
10•mkagenius•1h ago•0 comments

Meta hiding $27B in debt using advanced geometry

https://stohl.substack.com/p/exclusive-credit-report-shows-meta
201•FreeQueso•2h ago•94 comments

Lobsters Interview

https://susam.net/my-lobsters-interview.html
11•blenderob•2h ago•2 comments

Atuin’s New Runbook Execution Engine

https://blog.atuin.sh/introducing-the-new-runbook-execution-engine/
70•emschwartz•3d ago•8 comments

Show HN: Glasses to detect smart-glasses that have cameras

https://github.com/NullPxl/banrays
422•nullpxl•12h ago•155 comments

Show HN: An LLM-Powered Tool to Catch PCB Schematic Mistakes

https://netlist.io/
14•wafflesfreak•1h ago•7 comments

How wealth dies

https://surplusenergyeconomics.wordpress.com/2025/11/02/314-how-wealth-dies/
3•martinlaz•15m ago•0 comments

Analog Hoverboard Controller

https://github.com/skrubis/analog-hoverboard
7•skrubis•4d ago•0 comments

AI Adoption Rates Starting to Flatten Out

https://www.apolloacademy.com/ai-adoption-rates-starting-to-flatten-out/
100•toomuchtodo•2h ago•45 comments

Tech Titans Amass Multimillion-Dollar War Chests to Fight AI Regulation

https://www.wsj.com/tech/ai/tech-titans-amass-multimillion-dollar-war-chests-to-fight-ai-regulati...
157•thm•9h ago•155 comments

Moss: a Rust Linux-compatible kernel in 26,000 lines of code

https://github.com/hexagonal-sun/moss
318•hexagonal-sun•6d ago•82 comments

Petition to formally recognize open source work as civic service in Germany

https://www.openpetition.de/petition/online/anerkennung-von-open-source-arbeit-als-ehrenamt-in-de...
377•PhilippGille•4h ago•98 comments

Pocketbase – open-source realtime back end in 1 file

https://pocketbase.io/
568•modinfo•15h ago•159 comments

Stellantis Is Spamming Owners' Screens with Pop-Up Ads for New Car Discounts

https://www.thedrive.com/news/stellantis-is-spamming-owners-screens-with-pop-up-ads-for-new-car-d...
69•cf100clunk•2h ago•29 comments

Apple and Intel Rumored to Partner on Mac Chips

https://www.macrumors.com/2025/11/28/intel-rumored-to-supply-new-mac-chip/
56•bigyabai•1h ago•26 comments

Rock Paper Scissors Solitaire

https://klezlab.it/rock-paper-scissors-solitaire.html
6•klez•51m ago•1 comments

Airloom – 3D Flight Tracker

https://objectiveunclear.com/airloom.html
14•azinman2•1h ago•1 comments

Generating 3D Meshes from Text

https://cprimozic.net/notes/posts/generating-3d-meshes-from-text/
14•todsacerdoti•3h ago•1 comments

Molly: An Improved Signal App

https://molly.im/
6•dtj1123•57m ago•0 comments

A Tale of Four Fuzzers

https://tigerbeetle.com/blog/2025-11-28-tale-of-four-fuzzers/
48•jorangreef•6h ago•14 comments

A Remarkable Assertion from A16Z

https://nealstephenson.substack.com/p/a-remarkable-assertion-from-a16z
264•boplicity•6h ago•103 comments
Open in hackernews

Comparing floating-point numbers (2012)

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

Comments

LegionMammal978•6mo 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•6mo 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•6mo 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.