frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Project Glasswing: Securing critical software for the AI era

https://www.anthropic.com/glasswing
778•Ryan5453•5h ago•341 comments

Lunar Flyby

https://www.nasa.gov/gallery/lunar-flyby/
209•kipi•8h ago•48 comments

System Card: Claude Mythos Preview [pdf]

https://www-cdn.anthropic.com/53566bf5440a10affd749724787c8913a2ae0841.pdf
482•be7a•5h ago•349 comments

S3 Files

https://www.allthingsdistributed.com/2026/04/s3-files-and-the-changing-face-of-s3.html
158•werner•3h ago•43 comments

GLM-5.1: Towards Long-Horizon Tasks

https://z.ai/blog/glm-5.1
381•zixuanlimit•7h ago•110 comments

How to get better at guitar

https://www.jakeworth.com/posts/how-to-get-better-at-guitar/
138•jwworth•2d ago•59 comments

Cambodia unveils a statue of famous landmine-sniffing rat Magawa

https://www.bbc.com/news/articles/c0rx7xzd10xo
252•speckx•6h ago•57 comments

USD Purchasing Power in Real Time Since 2000

https://onedollar.today/
35•traviswingo•2h ago•30 comments

A truck driver spent 20 years making a scale model of every building in NYC

https://www.smithsonianmag.com/smart-news/a-truck-drive-spent-20-years-making-this-astonishing-sc...
224•1659447091•1d ago•36 comments

Show HN: Gemma 4 Multimodal Fine-Tuner for Apple Silicon

https://github.com/mattmireles/gemma-tuner-multimodal
104•MediaSquirrel•4h ago•9 comments

Show HN: An interactive map of Tolkien's Middle-earth

https://middle-earth-interactive-map.web.app/
42•frasermarlow•2h ago•6 comments

Show HN: Brutalist Concrete Laptop Stand (2024)

https://sam-burns.com/posts/concrete-laptop-stand/
680•sam-bee•12h ago•214 comments

A whole boss fight in 256 bytes

https://hellmood.111mb.de//A_whole_boss_fight_in_256_bytes.html
39•HellMood•2d ago•7 comments

Cloudflare targets 2029 for full post-quantum security

https://blog.cloudflare.com/post-quantum-roadmap/
256•ilreb•9h ago•82 comments

Rescuing old printers with an in-browser Linux VM bridged to WebUSB over USB/IP

https://printervention.app/details
133•gmac•7h ago•51 comments

Move Detroit

https://www.movedetroit.com/program
31•rmason•2h ago•37 comments

The Image Boards of Hayao Miyazaki

https://animationobsessive.substack.com/p/the-image-boards-of-hayao-miyazaki
79•vinhnx•1d ago•11 comments

A blind man made it possible for others with low vision to build Lego sets

https://apnews.com/article/lego-bricks-for-blind-audio-braille-instructions-5a2a27de4354a0b144317...
41•speckx•9h ago•5 comments

Google open-sources experimental agent orchestration testbed Scion

https://www.infoq.com/news/2026/04/google-agent-testbed-scion/
142•timbilt•10h ago•41 comments

AI helps add 10k more photos to OldNYC

https://www.danvk.org/2026/03/08/oldnyc-updates.html
111•evakhoury•1d ago•38 comments

Bitcoin and quantum computing

https://nehanarula.org/2026/04/03/bitcoin-and-quantum-computing.html
60•nehan•2h ago•48 comments

We found an undocumented bug in the Apollo 11 guidance computer code

https://www.juxt.pro/blog/a-bug-on-the-dark-side-of-the-moon/
372•henrygarner•13h ago•181 comments

Running out of disk space in production

https://alt-romes.github.io/posts/2026-04-01-running-out-of-disk-space-on-launch.html
140•romes•4d ago•72 comments

Taste in the age of AI and LLMs

https://rajnandan.com/posts/taste-in-the-age-of-ai-and-llms/
208•speckx•7h ago•178 comments

Design for the Roller Coaster

https://pointc.co/design-for-the-roller-coaster/
5•benwerd•5d ago•0 comments

9 Mothers (YC P26) Is Hiring – Lead Robotics and More

https://jobs.ashbyhq.com/9-mothers?utm_source=x8pZ4B3P3Q
1•ukd1•9h ago

Assessing Claude Mythos Preview's cybersecurity capabilities

https://red.anthropic.com/2026/mythos-preview/
234•sweis•5h ago•32 comments

John Coltrane illustrates the mathematics of jazz

https://www.americanjazzmusicsociety.com/blog/john-coltrane-draws
96•luu•17h ago•10 comments

Has electricity decoupled from natural gas prices in Germany?

https://has-electricity-decoupled-yet.strommarktberatung.de
65•konschubert•9h ago•103 comments

Ex-Meta worker investigated for downloading 30k private Facebook photos

https://www.bbc.com/news/articles/cvg049xz1ygo
5•1659447091•1h ago•0 comments
Open in hackernews

Comparing floating-point numbers (2012)

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

Comments

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