frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

A recent experience with ChatGPT 5.5 Pro

https://gowers.wordpress.com/2026/05/08/a-recent-experience-with-chatgpt-5-5-pro/
353•_alternator_•8h ago•195 comments

Google broke reCAPTCHA for de-googled Android users

https://reclaimthenet.org/google-broke-recaptcha-for-de-googled-android-users
1103•anonymousiam•16h ago•383 comments

Using Claude Code: The unreasonable effectiveness of HTML

https://twitter.com/trq212/status/2052809885763747935
179•pretext•6h ago•96 comments

OpenAI’s WebRTC problem

https://moq.dev/blog/webrtc-is-the-problem/
341•atgctg•1d ago•85 comments

Mythical Man Month

https://martinfowler.com/bliki/MythicalManMonth.html
185•ingve•2d ago•124 comments

Making Julia as Fast as C++ (2019)

https://flow.byu.edu/posts/julia-c++
15•d_tr•2d ago•2 comments

What causes lightning? The answer keeps getting more interesting

https://www.quantamagazine.org/what-causes-lightning-the-answer-keeps-getting-more-interesting-20...
76•Tomte•2d ago•13 comments

David Attenborough's 100th Birthday

https://www.bbc.com/news/articles/cp3pww9g0p5o
669•defrost•23h ago•136 comments

America's carpet capital: an empire and its toxic legacy

https://apnews.com/projects/pfas-forever-stained/
29•rawgabbit•2d ago•7 comments

AI is breaking two vulnerability cultures

https://www.jefftk.com/p/ai-is-breaking-two-vulnerability-cultures
348•speckx•17h ago•136 comments

Wi is Fi: Understanding Wi-Fi 4/5/6/6E/7/8 (802.11 n/AC/ax/be/bn)

https://www.wiisfi.com/
261•homebrewer•2d ago•62 comments

AWS North Virginia data center outage – resolved

https://www.cnbc.com/2026/05/08/aws-outage-data-center-fanduel-coinbase.html
228•christhecaribou•1d ago•153 comments

Cartoon Network Flash Games

https://www.webdesignmuseum.org/flash-game-exhibitions/cartoon-network-flash-games
349•willmeyers•19h ago•108 comments

The React2Shell Story

https://lachlan.nz/blog/the-react2shell-story/
154•mufeedvh•18h ago•10 comments

An Introduction to Meshtastic

https://meshtastic.org/docs/introduction/
459•ColinWright•1d ago•160 comments

You gave me a u32. I gave you root. (io_uring ZCRX freelist LPE)

https://ze3tar.github.io/post-zcrx.html
189•MrBruh•15h ago•111 comments

Can LLMs model real-world systems in TLA+?

https://www.sigops.org/2026/can-llms-model-real-world-systems-in-tla/
91•mad•19h ago•22 comments

Vladimir Putin is losing his grip on Russia

https://www.economist.com/by-invitation/2026/05/06/vladimir-putin-is-losing-his-grip-on-russia
10•bazzmt•40m ago•4 comments

Teaching Claude Why

https://www.anthropic.com/research/teaching-claude-why
175•pretext•17h ago•83 comments

Serving a website on a Raspberry Pi Zero running in RAM

https://btxx.org/posts/memory/
227•xngbuilds•20h ago•91 comments

Light without electricity? Glowing algae could make it possible

https://www.colorado.edu/today/2026/05/06/light-without-electricity-glowing-algae-could-make-it-p...
78•geox•2d ago•24 comments

The soul of maintaining a new machine

https://books.worksinprogress.co/book/maintenance-of-everything/communities-of-practice/the-soul-...
59•akkartik•3d ago•5 comments

Roadside Attraction

https://theoffingmag.com/essay/roadside-attraction/
23•aways•15h ago•3 comments

PortalVR Motion – use any VR content in 2D with 3D tracked Joy-Cons

https://portalvr.io/motion
23•gfodor•2d ago•1 comments

US Government releases first batch of UAP documents and videos

https://www.war.gov/UFO/
304•david-gpu•23h ago•442 comments

All means are fair except solving the problem

https://yosefk.com/blog/all-means-are-fair-except-solving-the-problem.html
62•akkartik•2d ago•47 comments

Bitter Lessons from the ISSpresso

https://mceglowski.substack.com/p/bitter-lessons-from-the-isspresso
105•zdw•2d ago•29 comments

How to Optimize MongoDB Query Performance with Indexes

https://visualeaf.com/blog/mongodb-query-optimization-indexes/
13•RoxiHaidi•2d ago•2 comments

When is your birthday? The math behind hash collisions

https://0xkrt26.github.io/math_behind_security/2026/05/08/birthday-problem.html
50•denismenace•15h ago•11 comments

EU calls VPNs "a loophole that needs closing" in age verification push

https://cyberinsider.com/eu-calls-vpns-a-loophole-that-needs-closing-in-age-verification-push/
254•muse900•5h ago•187 comments
Open in hackernews

Comparing floating-point numbers (2012)

https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
26•sph•12mo 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.