frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

SPEAKE(a)R: Turn Speakers to Microphones for Fun and Profit [pdf] (2017)

https://www.usenix.org/system/files/conference/woot17/woot17-paper-guri.pdf
59•Eridanus2•2h ago•24 comments

Archive of Byte magazine, starting with issue #1 in 1975

https://archive.org/details/byte-magazine-1975-09
16•DamnInteresting•1d ago•1 comments

Game devs explain the tricks involved with letting you pause a game

https://kotaku.com/video-game-devs-explain-how-pausing-works-and-sometimes-it-gets-weird-2000686339
138•speckx•2d ago•92 comments

What are skiplists good for?

https://antithesis.com/blog/2026/skiptrees/
100•mfiguiere•1d ago•21 comments

NIST scientists create 'any wavelength' lasers

https://www.nist.gov/news-events/news/2026/04/any-color-you-nist-scientists-create-any-wavelength...
318•rbanffy•14h ago•136 comments

Anonymous request-token comparisons from Opus 4.6 and Opus 4.7

https://tokens.billchambers.me/leaderboard
524•anabranch•18h ago•516 comments

College instructor turns to typewriters to curb AI-written work

https://sentinelcolorado.com/uncategorized/a-college-instructor-turns-to-typewriters-to-curb-ai-w...
289•gnabgib•16h ago•289 comments

The electromechanical angle computer inside the B-52 bomber's star tracker

https://www.righto.com/2026/04/B-52-star-tracker-angle-computer.html
341•NelsonMinar•18h ago•91 comments

Binary Dependencies: Identifying the Hidden Packages We All Depend On

https://vlad.website/binary-dependencies-identifying-the-hidden-packages-we-all-depend-on/
27•PaulHoule•2d ago•2 comments

The world in which IPv6 was a good design

https://apenwarr.ca/log/20170810
75•signa11•8h ago•16 comments

Updating Gun Rocket through 10 years of Unity Engine

https://jackpritz.com/blog/updating-gun-rocket-through-10-years-of-unity-engine
88•tyleo•2d ago•37 comments

Ask HN: How did you land your first projects as a solo engineer/consultant?

21•modelcroissant•1h ago•9 comments

Why Japan has such good railways

https://worksinprogress.co/issue/why-japan-has-such-good-railways/
423•RickJWagner•22h ago•406 comments

Keep Pushing: We Get 10 More Days to Reform Section 702

https://www.eff.org/deeplinks/2026/04/keep-pushing-we-get-10-more-days-reform-section-702
71•nobody9999•3h ago•6 comments

State of Kdenlive

https://kdenlive.org/news/2026/state-2026/
407•f_r_d•23h ago•124 comments

Modern Common Lisp with FSet

https://fset.common-lisp.dev/Modern-CL/Top_html/index.html
162•larve•3d ago•19 comments

It's cool to care (2025)

https://alexwlchan.net/2025/cool-to-care/
18•surprisetalk•3d ago•8 comments

Migrating from DigitalOcean to Hetzner

https://isayeter.com/posts/digitalocean-to-hetzner-migration/
792•yusufusta•21h ago•398 comments

Metatextual Literacy

https://www.jenn.site/metatextual-literacy/
34•dado3212•3d ago•3 comments

Optimizing Ruby Path Methods

https://byroot.github.io/ruby/performance/2026/04/18/faster-paths.html
104•weaksauce•14h ago•38 comments

Zero-Copy GPU Inference from WebAssembly on Apple Silicon

https://abacusnoir.com/2026/04/18/zero-copy-gpu-inference-from-webassembly-on-apple-silicon/
88•agambrahma•12h ago•34 comments

Dizzying Spiral Staircase with Single Guardrail Once Led to Top of Eiffel Tower

https://www.smithsonianmag.com/smart-news/a-dizzying-spiral-staircase-with-a-single-guardrail-onc...
29•bookofjoe•2d ago•12 comments

SI Units for Request Rate (2024)

https://entropicthoughts.com/si-units-for-request-rate
72•fanf2•3d ago•49 comments

Sumida Aquarium Posts 2026 Penguin Relationship Chart, with Drama and Breakups

https://www.sumida-aquarium.com/special/sokanzu/en/2026/
221•Lwrless•3d ago•12 comments

Thoughts and feelings around Claude Design

https://samhenri.gold/blog/20260418-claude-design/
315•cdrnsf•15h ago•200 comments

My first impressions on ROCm and Strix Halo

https://blog.marcoinacio.com/posts/my-first-impressions-rocm-strix-halo/
49•random_•13h ago•36 comments

Bypassing the kernel for 56ns cross-language IPC

https://github.com/riyaneel/Tachyon/tree/main/docs/adr
45•riyaneel•2d ago•22 comments

Scientists discover “cleaner ants” that groom giant ants in Arizona desert

https://www.sciencedaily.com/releases/2026/04/260414075641.htm
112•t-3•3d ago•39 comments

Show HN: MDV – a Markdown superset for docs, dashboards, and slides with data

https://github.com/drasimwagan/mdv
121•drasim•19h ago•44 comments

NASA Shuts Off Instrument on Voyager 1 to Keep Spacecraft Operating

https://science.nasa.gov/blogs/voyager/2026/04/17/nasa-shuts-off-instrument-on-voyager-1-to-keep-...
188•sohkamyung•11h ago•80 comments
Open in hackernews

Comparing floating-point numbers (2012)

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

Comments

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