frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

iPhone Duo

https://www.apple.com/iphone-duo/
759•thecosmicfrog•4h ago•1496 comments

Shopify acquires Tailwind

https://tailwindcss.com/blog/tailwind-is-joining-shopify
829•EdwinHoksberg•9h ago•333 comments

What do Visa and Mastercard do? An intro to card networks

https://tautology.town/2026/06/01/card-networks.html
299•evakhoury•1d ago•182 comments

AirPods 5

https://www.apple.com/newsroom/2026/09/apple-introduces-airpods-5-with-best-in-class-open-ear-act...
336•awad•5h ago•270 comments

iPhone 18 Pro and iPhone 18 Pro Max

https://www.apple.com/newsroom/2026/09/apple-debuts-iphone-18-pro-and-iphone-18-pro-max/
230•meetpateltech•5h ago•236 comments

Growing proof that autonomous cars save lives

https://spectrum.ieee.org/are-self-driving-cars-safe
153•bookofjoe•5h ago•254 comments

No Man's Sky Cosmos

https://www.nomanssky.com/cosmos-update/
257•Limb•7h ago•263 comments

Apple Watch Series 12

https://www.apple.com/newsroom/2026/09/introducing-apple-watch-series-12-with-the-all-new-health-...
184•Lealen•5h ago•207 comments

Qwen 3.8 follows GPT-5.5 Pro reasoning prefills

https://gist.github.com/wsxiaoys/e0286dc6bb624ff5fdf49e7f4c528ba3
148•wsxiaoys•5h ago•60 comments

GPT-6 Astra, looped transformers, and hidden reasoning

https://magazine.sebastianraschka.com/p/gpt-6-astra-looped-transformers-and
315•ModelForge•8h ago•116 comments

GNU Radio in the browser

https://gnuradioworld.com/
158•kristianpaul•7h ago•22 comments

Desert Ant Labs: local, fast models that run on device

https://desertant.com/blog/introducing-desert-ant-labs/
370•willwhitedc•11h ago•88 comments

Understanding the recent DDoS attack against Read the Docs

https://about.readthedocs.com/blog/2026/09/2026-ddos-attack/
140•davidfischer•7h ago•43 comments

How I advertise malicious software on Google Ads

https://xlii.space/eng/malicious-software-on-google-ads/
339•xlii•11h ago•202 comments

Planet Labs' open satellite feed

https://tech.marksblogg.com/planet-labs-open-satellite-feed.html
132•marklit•7h ago•25 comments

South Park creators rename show 'South America'

https://www.bbc.co.uk/news/articles/cp9340rg7k8o
57•hermitcrab•1h ago•7 comments

Bespoke: A programming language for people who say please

https://blog.hofstede.it/bespoke-a-programming-language-for-people-who-say-please/
106•birdculture•3d ago•25 comments

Procedural Graphs: Self-Evolving Execution Structures for LLM Agents

https://arxiv.org/abs/2609.09153
39•omarsar•5h ago•11 comments

Microsoft says email spammers are adopting ASCII smuggling

https://arstechnica.com/security/2026/09/once-popular-for-attacking-ai-ascii-smuggling-is-embrace...
29•utiiiD•4d ago•16 comments

Matt Mullenweg put on 'leave of absence'

https://www.404media.co/wordpress-automattic-ceo-matt-mullenweg-put-on-leave-of-absence/
132•doener•1h ago•71 comments

Ancient cave art suggests first known humans in Ireland walked over from Wales

https://www.bbc.com/news/articles/c5y75dl0jpko
36•bookofjoe•2d ago•8 comments

Why Emacs Consult async searches feel slow and how to speed them up

https://www.jamescherti.com/emacs-consult-speed-async-searche-grep-ripgrep-fd-find/
44•mpweiher•5h ago•15 comments

What will our economic future look like?

https://www.anthropic.com/institute/econ-scenarios
153•oumua_don17•9h ago•263 comments

Claude, change the “Add to Cart” button to blue

https://opusfived.dev/
943•matthieu_bl•13h ago•382 comments

Use Vsock with Libzmq

https://blog.remijouan.net/posts/libzmq-vsock-pyzmq/
9•remijouannet•2d ago•1 comments

Muse – Meta’s personal AI agent

https://ai.meta.com/muse/
634•yks•1d ago•691 comments

Show HN: Self-hosted company OS, Claude Code and Codex agents in departments

https://github.com/OtoDock/oto-dock
34•dimitrismrtzs•5h ago•8 comments

Roame (YC S23) Is Hiring Viral Content Editor

https://www.ycombinator.com/companies/roame/jobs/KuVVqSh-content-systems-builder-editor
1•zman0225•11h ago

Generating the P3 Tiling

https://k-monk.org/blog/generating-the-p3-tiling/
36•evakhoury•1d ago•5 comments

Coyote v. Acme (1990)

https://www.newyorker.com/magazine/1990/02/26/coyote-v-acme
162•ChrisArchitect•3d ago•79 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.