frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Show HN: TitleArt – Make text like it's 1997

https://titleart.dvy.io/
168•davidbarker•4h ago•24 comments

PaperPilot – Zero-Cloud, Pure-Rust PDF Engine with WASM and MCP

https://github.com/KrushnaVardhanReddy/PaperPilot
101•vardhan1237•4h ago•25 comments

Dolly Parton's Imagination Library

https://imaginationlibrary.com/
510•jumploops•13h ago•88 comments

Show HN: A Truly Modular Keyboard

https://github.com/notaroomba/keybytes
118•NotARoomba•1d ago•25 comments

Behind the scenes at the NeXT Computer office

https://exhibits.stanford.edu/menuez/browse/next-computer-inc?per_page=96&sort=pub_year_isi+asc%2...
80•Austin_Conlon•4h ago•35 comments

The Curse of Soldered RAM

https://blog.hardill.me.uk/2026/10/24/the-curse-of-soldered-ram/
54•gsky•1d ago•41 comments

Growing Trees

https://brashandplucky.com/2026/10/15/growing-trees.html
18•ibobev•2d ago•0 comments

Overgrown, when plants invade your abandoned tabs

https://charliegerard.dev/blog/overgrown-extension/
250•speckx•3d ago•80 comments

The result of the C++26 DIS ballot

https://train-it.eu/blog/cpp26-contracts-the-ballot-result/
6•uasi•1h ago•0 comments

Attention Is Not What You Need (2025)

https://arxiv.org/abs/2512.19428
86•westurner•8h ago•29 comments

IBM CEO says open weight models are now good and cheap on-prem

https://www.theregister.com/systems/2026/10/22/ibm-ceo-says-open-weight-models-are-now-irresistib...
198•Betelbuddy•6h ago•103 comments

Microsoft Decision-1: 9B Qwen Model Launch Explained

https://shattered.io/microsoft-decision-1-qwen3-5-9b-model-2026/
36•gmays•4h ago•15 comments

Why I Am a Programmer

https://www.alfie.wtf/programming/why-i-am-a-programmer.html
204•jruohonen•12h ago•62 comments

F-Zero X on Nintendo 3DS

https://hypnotize.works/gdx-3ds/postmortem/index.html
106•bpierre•8h ago•53 comments

Iron Age salt-mining complex found beneath Hallstatt in Austria

https://archaeologymag.com/2026/09/iron-age-salt-mining-complex-beneath-hallstatt/
58•janandonly•3d ago•11 comments

Steal My Bitcoin CTF PoC

https://github.com/KillaBoi/StealMyBitcoin-PoC
90•davikr•7h ago•17 comments

The State of Context Engineering

https://www.dbreunig.com/2026/10/24/the-state-of-context-engineering.html
158•pchristensen•11h ago•39 comments

Cognitive Mercantilism: AI panic resembles fears of early capitalism

https://contraptions.venkateshrao.com/p/cognitive-mercantilism
59•ianand•3h ago•54 comments

Show HN: ADRs for AI – Deliberation records for human–AI work, versioned in Git

https://adrs.systems
37•lumbroso•1d ago•20 comments

What goes into making an animated film?

https://www.disneyanimation.com/process/
134•embedding-shape•11h ago•57 comments

Amazon’s “digital pacifier” for toddlers

https://oligarchwatch.substack.com/p/amazons-digital-pacifier-for-toddlers
170•jumploops•4d ago•230 comments

We should be more ambitious with the software we build

https://danluu.com/ambitious/
788•ltratt•1d ago•705 comments

Removing Next.js Got My Blog to 100 on Every Lighthouse Category

https://korindiehacker.bloffy.blog/en/removing-nextjs-got-my-blog-to-100-on-every-lighthouse-cate...
114•textlanes33•6h ago•63 comments

A 10-year-old CNN outperforms frontier LLMs for skin cancer diagnosis

https://lynchlab.net/llm-skin-cancer
531•sungam•14h ago•234 comments

Retired decorator's Pokémon cards sell for £1.5M

https://www.bbc.co.uk/news/articles/cvp8gy1zwxxwo
42•HelloUsername•3d ago•35 comments

Making the Buddha Head from Merv Whole Again

https://www.getty.edu/news/buddha-head-of-merv-turkmenistan-conservation/
43•laybak•2d ago•0 comments

OpenAI and Anthropic cut their LLM prices by up to 80% within a few months. Why?

https://minimaxir.com/2026/10/cheap-llms/
274•minimaxir•10h ago•281 comments

Where the Romans Fought (interactive map)

https://iosiflazaridis.github.io/battles-of-the-romans/
80•endorphine•13h ago•32 comments

Root shell on Samsung TV

https://twitter.com/log4j/status/2113014142600953868?s=46
832•testing22321•2d ago•618 comments

Active incident at Dreamhost forcing password reset

https://www.dreamhoststatus.com/
141•greenchair•18h ago•58 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.