frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Grieving the Loss of Details

https://purplesyringa.moe/blog/grieving-the-loss-of-details/
46•signa11•4d ago•9 comments

Knuth Reward Check

https://www.thomas-huehn.com/knuth-reward-check
36•Curiositry•1h ago•13 comments

Talorys – A self-hosted personal AI agent on Cloudflare's free tier

https://github.com/rociiu/talorys
152•rociiu•6h ago•80 comments

Bitwarden Dual License Model

https://community.bitwarden.com/t/published-version-update-in-app-stores/102750
187•Cider9986•2h ago•137 comments

Rampart: Browser native on-device PII radaction

https://ndstudio.gov/posts/say-hello-to-rampart
34•nateb2022•23h ago•13 comments

Mxc: Microsoft Execution Containers version 1.0.0

https://blogs.windows.com/windowsdeveloper/2026/10/07/microsoft-execution-containers-policy-drive...
64•smokel•1d ago•8 comments

REA Reverse – Engineer Anything

https://rea.tools/
592•modinfo•16h ago•258 comments

Telegram Desktop vulnerability allowed any user's file to be stolen

https://beaksec.github.io/posts/telegram-desktop-one-click-account-takeover/
326•g-b-r•14h ago•164 comments

Triple-A Minesweeper

https://minesweeper.mikelacher.com/
1235•robin_reala•1d ago•244 comments

I would like the value of my home to rise, while my property taxes fall

https://conversableeconomist.com/2026/09/28/i-would-like-the-value-of-my-home-to-rise-while-my-pr...
94•colinprince•3h ago•201 comments

PVX-001: open-source Covid-19 vaccine starts Phase 1 trial

https://chronicles.popvax.com/p/popvax-goes-clinical
39•jajoosam•2h ago•10 comments

`123456' password used in Danish CPR data breach

https://cphpost.dk/2026-10-10/news/round-up/123456-password-used-in-massive-danish-cpr-data-breach/
317•baal80spam•7h ago•172 comments

Tom Brown used GOP ties to broker a $1.25B/month SpaceX compute deal

https://wsj.com/tech/ai/tom-brown-athropic-669005ad
44•utiiiD•2h ago•0 comments

Eye of Sauron: Long-Range Hidden Spy Camera Detection (2024)

https://www.usenix.org/conference/usenixsecurity24/presentation/zhang-qibo
251•ortusdux•2d ago•58 comments

Chernobyl particles reveal unexpectedly stable nuclear fuel after 40 years

https://phys.org/news/2026-10-chernobyl-particles-reveal-unexpectedly-stable.html
85•geox•3d ago•26 comments

WSL3 Performance is about 5-60% faster than WSL2 depending on the workload

https://tonym.us/wsl2-vs-wsl3-benchmarks.html
177•tonymet•2d ago•144 comments

FDA may allow some toxic chemicals to be added to food without safety review

https://www.theguardian.com/us-news/2026/oct/10/fda-toxic-chemicals-food-analysis
39•NewJazz•2h ago•22 comments

Can you use autoregressive diffusion to generate market data?

https://blog.janestreet.com/can-you-use-autoregressive-diffusion-to-generate-market-data/
155•jsomers•1d ago•44 comments

Apple/macOS silently removed from official Unix registry

https://www.opengroup.org//openbrand/register/
148•john_alan•6h ago•149 comments

Noto means "no tofu": fixing dotted circles in Myanmar text

https://www.datocms.com/blog/handling-less-common-scripts
42•steffoz•3d ago•24 comments

Cloudflare acquires Deno

https://deno.com/blog/cloudflare
1313•ilreb•1d ago•677 comments

Show HN: Carrier-Explode: iPhone, Pixel and Galaxy carrier settings decoded

https://carrierexplode.com/
384•simplyalec•23h ago•45 comments

AI Is Throwing a Roadside Picnic

https://metedata.substack.com/p/ai-is-throwing-a-roadside-picnic
16•young_mete•1h ago•13 comments

Compiling Rust to readable C with Eurydice

https://lwn.net/Articles/1055211/
123•peter_d_sherman•17h ago•34 comments

How Protein Took over the World

https://www.ft.com/content/e26574cf-94cc-40d9-921e-5c7417fc5dbd
23•thm•1h ago•30 comments

Timestamping a Giant Record of the Web

https://projecttimestamper.org/blog/common-crawl/
31•arthuredelstein•1d ago•2 comments

Clinical trial of a prion disease drug candidate begins enrolling participants

https://www.broadinstitute.org/news/clinical-trial-prion-disease-drug-candidate-begins-enrolling-...
136•luu•17h ago•35 comments

How to head into VR without wearing a headset

https://www.kyushu-u.ac.jp/en/researches/view/414/
61•Betelbuddy•4d ago•38 comments

Whooping Cranes Learned to Migrate by Following Costumed Pilots

https://theverifiedpost.com/article/whooping-cranes-ultralight-costumed-pilots-operation-migration
14•kgolubic•1d ago•0 comments

What mathematicians should know about the Lean Theorem Prover: reliability & AI

https://terrytao.wordpress.com/2026/10/09/what-mathematicians-should-know-about-the-lean-theorem-...
172•matt_d•23h ago•47 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.