frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

AI is forcing us to pay off 40 years of technical debt

https://spectrum.ieee.org/ai-in-cybersecurity-php2shell-vulnerability
665•pseudolus•5h ago•431 comments

Progress on provable inference for large language models

https://www.anthropic.com/research/provable-inference
24•ltononro•23m ago•5 comments

Guerrilla bike lanes: San Francisco makes illicit infrastructure permanent (2016)

https://99percentinvisible.org/article/guerrilla-bike-lanes-san-francisco-makes-illicit-infrastru...
120•zenincognito•2h ago•51 comments

Nvidia RTX Spark encrypted firmware slows inference speed to 35% on Linux

https://www.mindstudio.ai/blog/linux-nvidia-rtx-spark-laptop
443•novaRom•8h ago•195 comments

Evergreen: A Provably Safe Systems Language

https://evergreenlang.net
56•jordan_bonecut•2h ago•37 comments

AMD expects to outsell Intel in Q4 for the first time in history

https://www.tomshardware.com/pc-components/cpus/amd-expects-to-outsell-intel-in-q4-for-the-first-...
147•rbanffy•2h ago•45 comments

North Korean fake job interview led to $6.3B Binance heist

https://www.theregister.com/security/2026/11/03/north-korean-fake-job-interview-led-to-63b-binanc...
328•smalltech•3h ago•204 comments

Show HN: I built a tool that prices a prebuilt PC part by part

https://pcdealcheck.com/
28•adlep•2h ago•7 comments

Verification Is Not Knowledge: Science needs more than answers

https://blog.cosmos-institute.org/p/verification-is-not-knowledge
178•ersinesen•8h ago•101 comments

An end to buggy web apps

https://replay.io/blog/an-end-to-buggy-web-apps
22•bhackett•39m ago•12 comments

Kimi K3.1 Pro model weights are out

https://huggingface.co/moonshotai/Kimi-K3.1-Pro
118•abrarthought•2h ago•20 comments

Incident with Pull Requests, Git Operations and Issues

https://www.githubstatus.com/incidents/smtdswd1h2w4
202•kevcampb•7h ago•106 comments

Tell HN: Gemini trains on chat history, even for subscribers (personal accounts)

451•jameslk•7h ago•122 comments

Letting users trust their own MCP clients, without opening a phishing hole

https://streamvessel.com/blog/mcp-trusted-redirect-uris
21•isalexlog•2h ago•2 comments

Jelly Sheet

https://mrdoob.github.io/codevember-2026/01/
391•memalign•14h ago•104 comments

Adding Window Functions to a Spreadsheet

https://www.getgrist.com/blog/running-totals-you-dont-have-to-chase/
25•reedciccio•2h ago•16 comments

Show HN: Codemap – one-page interactive map of any Go repository

https://github.com/peterretief/codemap
26•peter_retief•2h ago•9 comments

Debian apt security update (man-in-the-middle)

https://lists.debian.org/debian-security-announce/2026/msg00526.html?pow_referer=
78•SG-•2h ago•15 comments

Kitty 0.50

https://sw.kovidgoyal.net/kitty/changelog/#
298•porridgeraisin•8h ago•192 comments

Stringman, an $800 open-source room scale gripper robot

https://neufangled.com/
739•nharada•1d ago•228 comments

Mocktastic: A Meshtastic Node on Arduino

https://github.com/Vapmuz/Mocktastic
19•kimi•3h ago•1 comments

Tencent Hy4

https://hy.tencent.ai/research/hy4
16•Philpax•3h ago•0 comments

Pierre Computer is being acquired by OpenAI

https://twitter.com/pierrecomputer/status/2117999036175188183
51•itunpredictable•2h ago•22 comments

The Internals of PostgreSQL

https://www.interdb.jp/pg/index.html
346•ibobev•19h ago•27 comments

Giant canyon on Mars is still tectonically active

https://lamont.columbia.edu/news/giant-canyon-mars-still-tectonically-active-today
133•gmays•16h ago•32 comments

Synaptics Appears to Use Legal Threats to Block Open-Source DisplayLink Driver

https://www.phoronix.com/news/Synaptics-Blocks-Vino-Driver
138•snvzz•6h ago•52 comments

The lost malloc()

https://napcakes.nekoweb.org/posts/malloc/
123•matt_d•10h ago•48 comments

Show HN: HackerTV – HN's most-recommended Youtube videos as 24/7 TV channels

https://hackertv.org
421•dsalzman•1d ago•78 comments

Show HN: Uncracked City, detective game where you question LLM suspects that lie

https://uncracked.city
114•passkey1510•20h ago•56 comments

Distinct cellular and genetic differences in colorectal cancer in young patients

https://www.dana-farber.org/newsroom/news-releases/2026/study-reveals-distinct-cellular-and-genet...
115•gmays•14h ago•52 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.