frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

NSA and IETF, part 3: Dodging the issues at hand

https://blog.cr.yp.to/20251123-dodging.html
158•upofadown•3h ago•43 comments

Fast Lua runtime written in Rust

https://astra.arkforge.net/
39•akagusu•1h ago•23 comments

Show HN: Cynthia – Reliably play MIDI music files – MIT / Portable / Windows

https://www.blaizenterprises.com/cynthia.html
32•blaiz2025•1h ago•10 comments

Shai-Hulud Returns: Over 300 NPM Packages Infected

https://helixguard.ai/blog/malicious-sha1hulud-2025-11-24
448•mrdosija•4h ago•361 comments

Booking.com cancels $4K hotel reservation, offers same rooms again for $17K

https://www.cbc.ca/news/gopublic/go-public-booking-com-hotel-rates-9.6985480
47•thisislife2•47m ago•26 comments

Slicing Is All You Need: Towards a Universal One-Sided Distributed MatMul

https://arxiv.org/abs/2510.08874
55•matt_d•4d ago•4 comments

Chrome Jpegxl Issue Reopened

https://issues.chromium.org/issues/40168998
38•markdog12•3h ago•11 comments

Serflings is a remake of The Settlers 1

https://www.simpleguide.net/serflings.xhtml
38•doener•2d ago•6 comments

We stopped roadmap work for a week and fixed bugs

https://lalitm.com/fixits-are-good-for-the-soul/
122•lalitmaganti•23h ago•225 comments

RuBee

https://computer.rip/2025-11-22-RuBee.html
289•Sniffnoy•12h ago•50 comments

Disney Lost Roger Rabbit

https://pluralistic.net/2025/11/18/im-not-bad/
326•leephillips•5d ago•129 comments

Show HN: Virtual SLURM HPC cluster in a Docker Compose

https://github.com/exactlab/vhpc
12•ciclotrone•4d ago•2 comments

Japan's gamble to turn island of Hokkaido into global chip hub

https://www.bbc.com/news/articles/c8676qpxgnqo
187•1659447091•12h ago•328 comments

Building the largest known Kubernetes cluster, with 130k nodes

https://cloud.google.com/blog/products/containers-kubernetes/how-we-built-a-130000-node-gke-cluster/
57•TangerineDream•2d ago•36 comments

The only GM EV1 ever publicly sold, and where it's going next

https://www.theautopian.com/how-the-only-gm-ev1-ever-sold-didnt-get-crushed-and-where-its-going-now/
45•zdw•5d ago•39 comments

µcad: New open source programming language that can generate 2D sketches and 3D

https://microcad.xyz/
310•todsacerdoti•18h ago•100 comments

Ask HN: Hearing aid wearers, what's hot?

259•pugworthy•13h ago•136 comments

Lambda Calculus – Animated Beta Reduction of Lambda Diagrams

https://cruzgodar.com/applets/lambda-calculus
110•perryprog•10h ago•7 comments

The Rust Performance Book (2020)

https://nnethercote.github.io/perf-book/
166•vinhnx•5d ago•25 comments

Native Secure Enclave backed SSH keys on macOS

https://gist.github.com/arianvp/5f59f1783e3eaf1a2d4cd8e952bb4acf
426•arianvanp•21h ago•172 comments

Show HN: Stun LLMs with thousands of invisible Unicode characters

https://gibberifier.com
152•wdpatti•12h ago•69 comments

New magnetic component discovered in the Faraday effect

https://phys.org/news/2025-11-magnetic-component-faraday-effect-centuries.html
171•rbanffy•4d ago•59 comments

I built an faster Notion in Rust

https://imedadel.com/outcrop/
81•PaulHoule•4d ago•46 comments

Bureau of Meteorology's new boss asked to examine $96M bill for website redesign

https://www.abc.net.au/news/2025-11-23/bureau-of-meteorology-new-website-cost-blowout-to-96-milli...
61•OuterVale•2h ago•41 comments

Fran Sans – font inspired by San Francisco light rail displays

https://emilysneddon.com/fran-sans-essay
1026•ChrisArchitect•21h ago•128 comments

Ego, empathy, and humility at work

https://matthogg.fyi/a-unified-theory-of-ego-empathy-and-humility-at-work/
103•mrmatthogg•13h ago•32 comments

Set theory with types

https://lawrencecpaulson.github.io//2025/11/21/Typed_Set_Theory.html
87•baruchel•2d ago•13 comments

Calculus for Mathematicians, Computer Scientists, and Physicists [pdf]

https://mathcs.holycross.edu/~ahwang/print/calc.pdf
331•o4c•22h ago•69 comments

The Cloudflare outage might be a good thing

https://gist.github.com/jbreckmckye/32587f2907e473dd06d68b0362fb0048
192•radeeyate•12h ago•141 comments

I put a real search engine into a Lambda, so you only pay when you search

https://nixiesearch.substack.com/p/i-put-a-real-search-engine-into-a
12•shutty•4h ago•2 comments
Open in hackernews

Comparing floating-point numbers (2012)

https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
26•sph•6mo ago

Comments

LegionMammal978•6mo 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•6mo 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•6mo 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.