frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

The End of an Athlon

http://www.os2museum.com/wp/the-end-of-an-athlon/
124•userbinator•6h ago•38 comments

To become a better writer, read as much as you can

https://nappertime.com/the-golden-rule-of-becoming-a-better-writer/
225•andsoitis•8h ago•146 comments

Sydney Marathon medal mistakenly depicts Munich stadium

https://www.bbc.com/news/articles/cvg92y1wzn8o
20•epestr•2h ago•4 comments

Show HN: Live 3D satellite tracker and the declassified Pentagon UFO archive

https://skylens.yantraai.app/
19•skylensspace•3h ago•0 comments

JIT Compiling Code in 5μs

https://malisper.me/jit-compiling-code-in-5-us/
88•zX41ZdbW•6h ago•50 comments

MartyPC is a cross-platform emulator of early PCs written in Rust

https://martypc.net/
134•boilerupnc•9h ago•43 comments

I gave Qwen 3.8 27B a reverse-engineering job and it finished in 30 minutes

https://www.xda-developers.com/qwen-3-8-27b-reverse-engineering-job-frontier-model/
49•raybb•2h ago•10 comments

Fast and Hard Code

https://lucumr.pocoo.org/2026/8/22/fast-hard-code/
54•tosh•6h ago•19 comments

Why your local LLM feels dumber than it is

https://forum.level1techs.com/t/why-your-local-llm-feels-dumber-than-it-is/253917
385•felineflock•18h ago•147 comments

The Art and Beauty of Blade Runner (2015)

https://nappertime.com/the-art-of-and-beauty-of-blade-runner/
105•cocacola1•11h ago•44 comments

Scrap (2006)

https://twitter.com/moxie/status/2091218652133732491
382•tosh•18h ago•201 comments

The Sloppification of Peptides

https://henryaj.substack.com/p/the-sloppification-of-peptides
47•henryaj•2h ago•17 comments

Hister – A private, full content search index that you control

https://hister.org/
383•auraham•4d ago•87 comments

ElevenLabs, TwelveLabs, ThirteenLabs

https://quantumi.sh/public/labs.html
417•jemoka•21h ago•129 comments

Thinking in Python

https://thinkinginpython.com/
204•pjacotg•18h ago•38 comments

typ.ing

https://typ.ing/
291•bookofjoe•4d ago•92 comments

RF Cafe

https://www.rfcafe.com/
214•gregsadetsky•4d ago•37 comments

NanoGPT Speedrun Frontier

https://www.primeintellect.ai/research/nanogpt-speedrun
115•stared•14h ago•28 comments

New MCP Roadmap

https://blog.modelcontextprotocol.io/posts/mcp-roadmap/
224•pentagrama•22h ago•136 comments

A week of using Codex more than Claude

https://allaboutcoding.ghinda.com/a-week-of-using-codex-more-than-claude/
212•speckx•1d ago•236 comments

How a Texas student blew the whistle on a rogue AI hacking attempt

https://www.reuters.com/world/how-texas-student-blew-whistle-rogue-ai-hacking-attempt-2026-08-20/
172•olalonde•1d ago•82 comments

A Friendly Introduction to Racket

https://geometridae.bearblog.dev/a-friendly-introduction-to-racket/
242•signa11•22h ago•131 comments

NetBSD and my life (2005)

https://mail-index.netbsd.org/netbsd-advocacy/2005/09/10/0000.html
131•gnyeki•17h ago•29 comments

Wi-Fi 8 is the first wireless upgrade in years that isn't chasing speed

https://www.xda-developers.com/wi-fi-8-first-wireless-upgrade-years-isnt-chasing-speed-home-netwo...
133•taubek•5h ago•98 comments

ATProto spaces: A new extension to ATProto that enables non-public data

https://atproto.com/blog/atproto-spaces-alpha
150•grappler•2d ago•20 comments

Munder Difflin – Agent harness to run an office of your clones

https://munderdiffl.in/
290•simonpure•1d ago•125 comments

Figmimic – A bookmarklet to copy any webpage into Figma as editable layers

https://marcua.net/minitools/figmimic/
105•speckx•18h ago•14 comments

I set a trap for a book-marketing scammer (2025)

https://rwwgreene.substack.com/p/i-set-a-trap-for-a-book-marketing
56•rznicolet•18h ago•38 comments

Show HN: Public Muscriptor Instance (latest, most powerful Audio-to-MIDI model)

https://www.pianoify.net/
50•jardy•1d ago•9 comments

Z80 – The 1970s Microprocessor Still Alive (2021)

https://www.computer.org/csdl/magazine/mi/2021/06/09623402/1yJTvlRLmhi
143•asdefghyk•1d ago•74 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.