frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

It took a year to ship WebAssembly in Anubis

https://anubis.techaro.lol/blog/2026/anubis-wasm/
57•xena•1h ago•31 comments

Show HN: Mador – Make any DOM reactive with a tiny 80-line Proxy state tuple

https://github.com/marsbos/mador
33•bosmarcel•1h ago•12 comments

Your intellectual fly is open (2025)

https://bcantrill.dtrace.org/2025/12/05/your-intellectual-fly-is-open/
437•cyb0rg0•9h ago•282 comments

GrapheneOS Overhauled Default Apps and Secure Clipboard

https://grapheneos.social/@GrapheneOS/117225539756835649
45•Cider9986•1h ago•15 comments

Isar Aerospace reaches orbit and deploys payloads on second flight

https://isaraerospace.com/press/history-for-european-spaceflight-isar-aerospace-reaches-orbit-and...
517•mpweiher•14h ago•167 comments

NetBSD 9.5 released and EOL for NetBSD-9

https://blog.netbsd.org/tnf/entry/netbsd_9_5_released_and
95•jaypatelani•6h ago•4 comments

Black Hole of Los Alamos Seller of surplus nuclear research materials (2011)

https://www.atlasobscura.com/places/black-hole-of-los-alamos
16•Bluestein•4d ago•4 comments

Show HN: VODForge – a free local desktop UI for YouTube video/playlist downloads

https://getvodforge.com/
17•coopernusbaum•1h ago•1 comments

Babylonian Lamb Stew with Beets (1750–1730 BCE)

https://babylonian-collection.yale.edu/about/babylonian-cooking
62•yubblegum•3d ago•24 comments

Research carried out using NetBSD

https://www.netbsd.org/gallery/research.html
64•Bluestein•5h ago•14 comments

Harnessing the Universal Geometry of Embeddings

https://arxiv.org/abs/2505.12540
7•ur-whale•1h ago•0 comments

Asahi Linux on M3

https://asahilinux.org/2026/09/m2-episode-1/
265•mdp2021•7h ago•153 comments

An Alien Mind

https://openai.com/index/an-alien-mind/
267•tosh•5h ago•206 comments

A/I shuts down – Stay human

https://keepitfree.ai/announcements/a/i-shuts-down-stay-human/
450•captainmuon•7h ago•299 comments

Electronic skin for prosthetics to sense temperature and pressure

https://news.wsu.edu/press-release/2026/08/20/researchers-develop-electronic-skin-for-prosthetics...
34•gmays•4d ago•5 comments

Opalite Health (YC W26) Is Hiring – Founding GTM

https://www.ycombinator.com/companies/opalite-health/jobs/bNedVAD-founding-gtm
1•ckuo9•4h ago

Vidact – a compiler that turns React into direct DOM operations

https://www.vidact.dev/
38•mohebifar•4d ago•18 comments

Doomscrolling Ourselves to Death

https://www.edwest.co.uk/p/doomscrolling-ourselves-to-death
328•shubhamjain•10h ago•226 comments

Human archive: They were only human

https://sayyss.github.io/human-archive/
8•jonwinstanley•1h ago•3 comments

Reverse engineering the storage format for an undocumented database

https://blog.glazer.ee/posts/converting-cronos/
3•pintprint•2d ago•0 comments

The car industry A/B tested selling a car with and without CarPlay

https://a.wholelottanothing.org/the-car-industry-a-b-tested-selling-the-same-car-with-and-without...
80•gumby•2h ago•64 comments

M-DISC – DVD/Blu-ray compatible discs that may last up to 1000 years

https://en.wikipedia.org/wiki/M-DISC
167•gurjeet•4d ago•77 comments

The revolt of the reader

https://bcantrill.dtrace.org/2026/09/05/the-revolt-of-the-reader/
554•chmaynard•1d ago•269 comments

Cloud in a Bottle: making self-hosting accessible to everyone

https://cloudinabottle.org/blog/launch-post
597•zplizzi•21h ago•294 comments

Research acceleration: The view inside OpenAI

https://openai.com/index/research-acceleration-view-inside-openai
86•iamsyr•6h ago•57 comments

Nitter and XCancel resume service after legal advice

https://github.com/zedeus/nitter/commit/1428b4c2b4246f92a7e5b2673438e5fb39fcc4a3
328•zImPatrick•4h ago•196 comments

Is There I/O After Death? What Happens to Io_uring When a Process Dies

https://blog.ydb.tech/is-there-i-o-after-death-what-happens-to-io-uring-when-a-process-dies-92c65...
56•porridgeraisin•4d ago•26 comments

Windows 11's "special" developer edition looks like another marketing misfire

https://www.neowin.net/opinions/windows-11s-special-developer-edition-sounds-like-yet-another-mar...
11•bundie•37m ago•1 comments

IBM Quantum Nighthawk R2

https://www.ibm.com/quantum/blog/nighthawk-r2
77•fuglede_•3d ago•35 comments

Music Theory for Programmers

https://runjs.app/blog/music-theory-for-programmers
342•birdculture•4d ago•219 comments
Open in hackernews

Comparing floating-point numbers (2012)

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

Comments

LegionMammal978•1y 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•1y 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•1y 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.