frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

this css proves me human

https://will-keleher.com/posts/this-css-makes-me-human/
73•todsacerdoti•1h ago•19 comments

Tech employment now significantly worse than the 2008 or 2020 recessions

https://twitter.com/JosephPolitano/status/2029916364664611242
611•enraged_camel•5h ago•409 comments

Hardening Firefox with Anthropic's Red Team

https://www.anthropic.com/news/mozilla-firefox-security
419•todsacerdoti•11h ago•123 comments

Show HN: Moongate – Ultima Online server emulator in .NET 10 with Lua scripting

https://github.com/moongate-community/moongatev2
210•squidleon•8h ago•122 comments

Open Camera is a FOSS camera app for Android

https://opencamera.org.uk/
187•tetris11•4d ago•85 comments

Apache Otava

https://otava.apache.org/
64•djoldman•5d ago•4 comments

Launch HN: Palus Finance (YC W26): Better yields on idle cash for startups, SMBs

30•sam_palus•4h ago•38 comments

Ada 2022

https://www.adaic.org/ada-resources/standards/ada22/
89•tosh•3h ago•16 comments

Art Bits from HyperCard

https://archives.somnolescent.net/web/mari_v2/junk/hypercard/
29•TigerUniversity•1h ago•5 comments

Payphone Go

https://walzr.com/payphone-go/
279•walz•4d ago•59 comments

Math Notepad

https://mathnotepad.com
16•the-mitr•4d ago•7 comments

Triplet Superconductor

https://www.sciencedaily.com/releases/2026/02/260221000252.htm
39•jonbaer•4d ago•8 comments

The Shady World of IP Leasing

https://acid.vegas/blog/the-shady-world-of-ip-leasing/
14•alibarber•1h ago•3 comments

CT Scans of Health Wearables

https://www.lumafield.com/scan-of-the-month/health-wearables
165•radeeyate•8h ago•35 comments

Astra: An open-source observatory control software

https://github.com/ppp-one/astra
72•pppone•6h ago•18 comments

Entomologists use a particle accelerator to image ants at scale

https://spectrum.ieee.org/3d-scanning-particle-accelerator-antscan
81•gmays•7h ago•10 comments

A tool that removes censorship from open-weight LLMs

https://github.com/elder-plinius/OBLITERATUS
89•mvdwoord•8h ago•33 comments

Multifactor (YC F25) Is Hiring an Engineering Lead

https://www.ycombinator.com/companies/multifactor/jobs/lcpd60A-engineering-lead
1•multifactor•6h ago

LibreSprite – open-source pixel art editor

https://libresprite.github.io/
237•nicoloren•13h ago•78 comments

The worst acquisition in history, again

https://www.profgmedia.com/p/the-worst-acquisition-in-history
74•JumpCrisscross•2h ago•52 comments

Workers who love ‘synergizing paradigms’ might be bad at their jobs

https://news.cornell.edu/stories/2026/03/workers-who-love-synergizing-paradigms-might-be-bad-thei...
472•Anon84•9h ago•275 comments

Analytic Fog Rendering with Volumetric Primitives (2025)

https://matejlou.blog/2025/02/11/analytic-fog-rendering-with-volumetric-primitives/
76•surprisetalk•1d ago•4 comments

Good Bad ISPs

https://community.torproject.org/relay/community-resources/good-bad-isps/
88•rzk•8h ago•25 comments

Anthropic, please make a new Slack

https://www.fivetran.com/blog/anthropic-please-make-a-new-slack
134•georgewfraser•3h ago•104 comments

Show HN: Reconstruct any image using primitive shapes, runs in-browser via WASM

https://github.com/taiseiue/primitive-playground
17•taiseiue•3d ago•4 comments

Global warming has accelerated significantly

https://www.researchsquare.com/article/rs-6079807/v1
886•morsch•9h ago•876 comments

TypeScript 6.0 RC

https://devblogs.microsoft.com/typescript/announcing-typescript-6-0-rc/
57•johnz•2h ago•8 comments

Show HN: Claude-replay – A video-like player for Claude Code sessions

https://github.com/es617/claude-replay
49•es617•7h ago•24 comments

Paul Brainerd, founder of Aldus PageMaker, has died

https://blog.adafruit.com/2026/03/04/pagemaker-and-aldus-founder-pioneer-paul-brainerd-1947-2026/
124•fortran77•7h ago•26 comments

We might all be AI engineers now

https://yasint.dev/we-might-all-be-ai-engineers-now/
153•sn0wflak3s•13h ago•238 comments
Open in hackernews

Comparing floating-point numbers (2012)

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

Comments

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