frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Show HN: Coldframe, a honeypot that poses as a supermarket fridge controller

https://github.com/hedgerow-dev/coldframe
31•hedgerow-dev•42m ago•6 comments

The $8 Linux Computer (2022)

http://thelittleengineerthatcould.blogspot.com/2022/12/the-8-linux-computer.html
126•zenincognito•4h ago•52 comments

Need for Speed Underground 2 online in the browser

https://nfsu2.xyz/
542•fluxusars•8h ago•166 comments

How Long Can Life Wait?

https://mceglowski.substack.com/p/how-long-can-life-wait
43•Ariarule•1h ago•12 comments

Text.js: Build full-stack React apps that render inside console.log

https://textjs.org/
37•nateb2022•3d ago•14 comments

Libghostty 1.0

https://mitchellh.com/writing/libghostty-1-0
934•mfiguiere•18h ago•155 comments

Running a law firm on Free software

https://decoded.legal/blog/2026/11/running-a-law-firm-on-free-software-2026-edition/
152•DeepLogin•8h ago•75 comments

British Library Legal deposit and web archiving

https://www.bl.uk/services/legal-deposit/web-archiving
43•robtherobber•4d ago•21 comments

Every Mac comes with an (undocumented) family member classifier

https://8rank.ai/game/apple-intelligence-personal-knowledge-graph
430•infwhispers•8h ago•247 comments

Tasfer: a text editor drawn on a 2D canvas

https://www.hamza.se/blog/tasfer
41•hamza512b•3d ago•17 comments

Ask HN: How did you convince family and friends to join your XMPP/Matrix server?

54•mtlynch•2h ago•30 comments

They don't make 'em like that any more: Borland Turbo Pascal 7

https://kevinboone.me/tpwin.html
89•andsoitis•2h ago•58 comments

Building the NBC News Big Board

https://ejfox.com/projects/nbc-big-board
48•whalesalad•3d ago•17 comments

Apple Keyboard has a blacklist of phrases you can't swipe

https://www.theguardian.com/technology/2026/nov/06/struggling-to-spell-male-chauvinist-pig-apple-...
43•user_7832•1h ago•23 comments

The Gordon Gekko Effect: The Role of Culture in the Financial Industry [pdf]

https://www.newyorkfed.org/medialibrary/media/research/epr/2016/epr_2016_gordon-gekko-effect_lo.pdf
20•tylerdane•3h ago•12 comments

A Jev that can ask Opus for help gives Opus accuracy at 4x lower cost

https://hightouch.com/blog/llm-judges-identity-resolution
552•theanomaly•22h ago•136 comments

ToothPaste

https://brisk4t.github.io/blog/toothpaste/
72•speckx•3d ago•16 comments

Show HN: Spindle – a full-featured, type-safe web framework for OCaml 5

https://github.com/hyphatech/spindle
44•zaiev•2d ago•8 comments

Optimising the Rail Cube

https://owenlacey.dev/railcube-optimisation/post
3•owenlacey•3d ago•0 comments

Show HN: We compressed a 31B video+audio diffusion model to 14B, 6 steps, INT8

https://github.com/Video-Rebirth/hyperflow-h3-flash
9•jiant•2h ago•3 comments

ZeBridge – PostgreSQL replicas on devices, synchronized over NATS

https://github.com/ndrean/ZeBridge
6•ndrean•4d ago•1 comments

Greece has its own Pompeii: Thera buried Akrotiri in ash 17th-16th century BCE

https://www.smithsonianmag.com/history/greece-has-its-own-pompeii-and-the-ruins-tell-a-captivatin...
180•derbOac•3d ago•25 comments

US FAA says it will phase out floppy disks from air traffic control by 2028

https://www.reuters.com/world/us/us-faa-says-it-will-phase-out-floppy-disks-air-traffic-control-b...
387•ChrisArchitect•1d ago•317 comments

The Components of Agent Memory

https://www.anthropic.com/research/components-of-agent-memory
118•geoffbp•11h ago•65 comments

Firecracker VM Escape: PwnEscape Part 2

https://pwn.ai/blog/firecracker-escape
273•SerCe•22h ago•117 comments

PostgreSQL Internals [pdf] (2023)

https://edu.postgrespro.com/postgresql_internals-14_en.pdf
76•Foe•3d ago•7 comments

8088 Domination Post-Mortem

https://trixter.oldskool.org/2014/06/19/8088-domination-post-mortem-part-1/
55•cosmojg•3d ago•7 comments

Notes on San Marino

https://mattlakeman.org/2026/11/05/notes-on-san-marino/
123•yorwba•1d ago•47 comments

The great butter and cheese fire of 1991

https://www.wisfarmer.com/story/opinion/columnists/2022/05/11/over-20-m-lbs-commodities-lost-grea...
73•subroutine•2d ago•21 comments

The Flash C Compiler

https://blog.adafruit.com/2026/10/31/flash-c-compiler/
95•AlexeyBrin•4d ago•48 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.