frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Hardware Attestation as Monopoly Enabler

https://grapheneos.social/@GrapheneOS/116550899908879585
166•ChuckMcM•54m ago•32 comments

Incident Report: CVE-2024-YIKES

https://nesbitt.io/2026/02/03/incident-report-cve-2024-yikes.html
69•miniBill•1h ago•10 comments

Tracesofhumanity.org by Joanna Rutkowska

https://tracesofhumanity.org/hello-world/
47•alex77456•1h ago•7 comments

Walking slower? Your ears, not your knees, might be the problem

https://www.wsj.com/health/wellness/hearing-loss-walking-speed-iphone-study-c53c482a
43•marc__1•1d ago•33 comments

I returned to AWS and was reminded why I left

http://fourlightyears.blogspot.com/2026/05/i-returned-to-aws-and-was-reminded-hard.html
471•andrewstuart•1d ago•368 comments

Idempotency is easy until the second request is different

https://blog.dochia.dev/blog/idempotency/
231•ludovicianul•3d ago•140 comments

Louis Rossmann offers to pay legal fees for a threatened OrcaSlicer developer

https://www.tomshardware.com/3d-printing/louis-rossmann-tells-3d-printer-maker-bambu-lab-to-go-bl...
253•iancmceachern•4h ago•169 comments

What's a mathematician to do? (2010)

https://mathoverflow.net/questions/43690/whats-a-mathematician-to-do
108•ipnon•7h ago•56 comments

5x perf increase on writes with FPW disabled in Postgres

https://www.databricks.com/blog/how-lakebase-architecture-delivers-5x-faster-postgres-writes
34•sp_from_db•2d ago•4 comments

Space Cadet Pinball on Linux

https://brennan.io/2026/05/09/pinball-and-escrow/
256•jandeboevrie•7h ago•84 comments

The Locals Don't Know

https://www.quarter--mile.com/The-Locals-Dont-Know
12•herbertl•2h ago•6 comments

Bun's experimental Rust rewrite hits 99.8% test compatibility on Linux x64 glibc

https://twitter.com/jarredsumner/status/2053047748191232310
677•heldrida•1d ago•644 comments

Stop MitM on the first SSH connection, on any VPS or cloud provider

https://www.joachimschipper.nl/Stop%20MITM%20on%20the%20first%20SSH%20connection,%20on%20any%20VP...
9•JoachimSchipper•2d ago•3 comments

Spain just became one of Europe's cheapest power markets. Here is how

https://janrosenow.substack.com/p/spain-just-became-one-of-europes
47•marc__1•2h ago•16 comments

The One Dollar Counterfeiter

https://www.amusingplanet.com/2026/05/emerich-juettner-one-dollar.html
281•cainxinth•3d ago•119 comments

Shunting-Yard Animation

https://somethingorotherwhatever.com/shunting-yard-animation/
25•s1291•3h ago•10 comments

Show HN: Building a web server in assembly to give my life (a lack of) meaning

https://github.com/imtomt/ymawky
355•imtomt•15h ago•192 comments

Think Linear Algebra (2023)

https://allendowney.github.io/ThinkLinearAlgebra/index.html
107•tamnd•9h ago•11 comments

Academic Research Skills for Claude Code

https://github.com/Imbad0202/academic-research-skills
58•arnon•5h ago•19 comments

9 Mothers (YC P26) Is Hiring

https://jobs.ashbyhq.com/9-mothers?utm_source=x8pZ4B3P3Q
1•ukd1•6h ago

Show HN: An index of indie web/blog indexes

https://theindex.fyi
34•rocketpastsix•5h ago•15 comments

Task Paralysis and AI

https://g5t.de/articles/20260510-task-paralysis-and-ai/index.html
127•MrGilbert•12h ago•79 comments

Internet Archive Switzerland

https://blog.archive.org/2026/05/06/internet-archive-switzerland-expanding-a-global-mission-to-pr...
670•hggh•1d ago•108 comments

Casio S100X Japanese Lacquer Edition (JP Page Only)

https://www.casio.com/jp/basic-calculators/premium/en-s100x-jc1-u/
267•dr_kiszonka•3d ago•121 comments

The River Otter's Remarkable Comeback

https://www.rewildingmag.com/the-river-otters-remarkable-comeback/
63•surprisetalk•3d ago•13 comments

I’ve banned query strings

https://chrismorgan.info/no-query-strings
511•susam•1d ago•268 comments

Chrome's AI features may be hogging 4GB of your computer storage

https://www.theverge.com/tech/924933/google-chrome-4gb-gemini-nano-ai-features
58•birdculture•3h ago•26 comments

We see something that works, and then we understand it

https://lemire.me/blog/2025/12/04/we-see-something-that-works-and-then-we-understand-it/
170•surprisetalk•4d ago•66 comments

GitHub is sinking

https://dbushell.com/2026/04/29/github-is-sinking/
98•herbertl•2h ago•70 comments

Rotten Dot Com

https://www.theparisreview.org/blog/2026/05/06/rotten-dot-com/
87•lordgrenville•10h ago•97 comments
Open in hackernews

Comparing floating-point numbers (2012)

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

Comments

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