frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

The group chat where your AI talks behind your back

https://construct22.com/
163•utiiiD•2h ago•56 comments

AI made self-hosting fun again

https://janlukas.blog/posts/ai-self-hosting
638•jlelse•11h ago•328 comments

The need for a formally verifiable mainstream programming language

https://blainehansen.me/post/mainstream-verifiable-language/
134•todsacerdoti•3h ago•107 comments

YouTube Ad Punisher – Auto-reloads YouTube pages when an ad plays

https://github.com/antonpictures/youtube-punisher
383•iantongeorge•15h ago•449 comments

Kamil Khan Mumtaz: Pakistani architect, admired at home, almost invisible abroad

https://worksinprogress.co/issue/the-greatest-architect-youve-never-heard-of-is-in-pakistan/
357•dverlaeckt80•11h ago•90 comments

Hard Drive pricing has gotten bad

https://blog.ktz.me/black-friday-hard-drive-prices-are-messed-up/
329•zdw•7h ago•232 comments

AMD-specific fork of llama.cpp

https://devnull.land/amd-specific-llama-cpp
349•julianlam•15h ago•83 comments

CTO of 'RansomwareHelp' indicted for wire fraud

https://krebsonsecurity.com/2026/11/cto-of-ransomwarehelp-indicted-for-wire-fraud/
262•Bender•15h ago•134 comments

Company Culture = Slack Emoji ÷ √Headcount

https://lia.mg/posts/measuring-company-culture-with-slack-emoji/
318•liamg•12h ago•134 comments

Intel One Mono font (2023)

https://github.com/intel/intel-one-mono
518•saikatsg•22h ago•251 comments

An introduction to uncertainty in machine learning

https://chrhenning.com/blog/2026/introduction-to-uncertainty/
75•chrhenning•13h ago•2 comments

Buy Nothing Day – Friday November 27th 2026

https://www.buynothingday.co.uk/
59•f_allwein•3h ago•8 comments

Google Will Make AI Agents Use Its MCP Servers. The Gmail One Can't Send Email

https://techstackups.com/articles/google-workspace-ai-agents-mcp/
323•ritzaco•23h ago•289 comments

Novita, StreamLake, etc. are ByteDance Ark wrappers

https://kendell.dev/blog/arkwrapper/
95•leafingensemble•11h ago•14 comments

Rvoip: VoIP stack in Rust

https://github.com/eisenzopf/rvoip
124•zerosegfaults•13h ago•27 comments

The Cutthroat Business of Shipwrecks

https://daily.jstor.org/the-cutthroat-business-of-shipwrecks/
24•herbertl•7h ago•2 comments

Show HN: I wrote an entire Vim manual over 4 years

http://themouseless.dev/vim/
159•thanato0s•18h ago•49 comments

Show HN: Olumino, a Markdown notes and spaced repetition app

https://olumino.app
104•Wiyseful•1d ago•45 comments

The USAID Files

https://reclaimthenet.org/usaid-files
249•MassPikeMike•1d ago•307 comments

An algebraic quantization of gravity from the null cone

https://arxiv.org/abs/2611.34924
237•hecmmm•1d ago•94 comments

Largest 2D Chart library in the world using BUI: BlenderUI

https://bui.preetham.top/charts/
101•ppmpreetham•14h ago•29 comments

Curiosity Is No Solo Act

https://thereader.mitpress.mit.edu/curiosity-is-no-solo-act/
150•Petiver•2d ago•37 comments

George Whitesides, 1939-2026

https://www.science.org/content/blog-post/george-whitesides-1939-2026
74•dverlaeckt80•14h ago•7 comments

Moat: OpenRouter replacement

https://commandcode.ai/moat
281•amanverasia•1d ago•156 comments

1Password Security Incident

https://1password.com/blog/update-on-nov-2026-security-incident
1661•lxhrstn•1d ago•712 comments

NormalScript: A perfectly normal scripting language

https://psychoscript.com/
104•hn-aarvin•1d ago•25 comments

Tell HN: Happy Thanksgiving

692•ericmay•18h ago•146 comments

Nextcloud Office Desktop app

https://nextcloud.com/blog/euro-office-comes-to-your-desktop-with-the-nextcloud-office-desktop-app/
431•e12e•21h ago•221 comments

Show HN: Three Linux VMs in a browser tab, each running a different browser

https://michidk.github.io/sidebyside/
137•michidk•18h ago•31 comments

Discovery of curse ritual in trash dump surprises Egyptologist

https://phys.org/news/2026-11-discovery-curse-ritual-trash-dump.html
105•PaulHoule•3d ago•59 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.