frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Too many men suffering in silence, national health report finds (Canada)

https://www.westcentralonline.com/articles/too-many-men-suffering-in-silence-national-health-repo...
170•nosecreek•1h ago•111 comments

Payments Canada announces launch of Canada's Real-Time Rail (RTR) payment system

https://www.payments.ca/canada-launches-real-time-rail-bringing-247-payment-infrastructure-nation...
291•ocd•3h ago•172 comments

Our Smallest, Most Efficient Model: Muse Ember

https://research.meta.ai/blog/muse-ember
81•dvaplima•1h ago•37 comments

Claude Fable 5.2 and Mythos 5.2

https://www.anthropic.com/claude-fable-and-mythos-5-2
249•meetpateltech•35m ago•73 comments

Infineon marks innovation milestone with 300mm power silicon carbide wafer

https://www.infineon.com/press-release/2026/infpr202611-028
31•sshah03•1h ago•6 comments

Fold Epic Paper Airplanes

https://www.foldableflight.com
640•vismit2000•7h ago•109 comments

DeepX claims inference up to 100B parameters at less than 5 W

https://www.eetimes.com/deepx-tapes-out-second-gen-chip-projects-6-7x-performance-gain-with-lpddr...
21•giuliomagnifico•58m ago•2 comments

Magenta solar panels may be agrivoltaics' cleverest trick yet

https://www.anthropocenemagazine.org/2026/10/magenta-solar-panels-may-be-agrivoltaics-cleverest-t...
161•speckx•5h ago•67 comments

Show HN: MeowDisplay Is iPhone Mirroring, but in Reverse

https://meowdisplay.app/
21•raiseCatError•52m ago•10 comments

Show HN: Every satellite that passed over any place this week, and its photos

https://www.watched.earth
37•a585gupt•1h ago•4 comments

Y/N (YC S23) is hiring a growth lead to distribute superhuman A.I. storytelling

https://www.ycombinator.com/companies/yn/jobs/TjDn3YZ-founding-growth-marketer
1•gabrielbirnbaum•2h ago

Show HN: DBDelve – Open-Source DB Client Made with Rust and GPUI

55•shayan_abbas•2h ago•17 comments

Is Opus 5.5 nerfed? Thinking patterns changed on November 3

https://twitter.com/shanemelaugh/status/2119192075505893695
497•rzk•12h ago•371 comments

Zebkit – Chromium as an embeddable library

https://github.com/ikey4u/zebkit
93•Riiiiichard•4h ago•35 comments

When will this stop? The Raspberry Pi 5 16GB SBC now sells for $385

https://www.cnx-software.com/2026/11/03/when-will-this-stop-the-raspberry-pi-5-16gb-sbc-now-sells...
151•pera•1h ago•129 comments

What is malloc doing, anyway?

https://benmandrew.com/articles/what-is-malloc-doing-anyway
171•benmandrew•8h ago•37 comments

Going back two years on Hacker News is like entering another, better universe

https://news.ycombinator.com/front?day=2024-11-08
163•EmX_3000•1h ago•81 comments

A primer on GPUs and kernel optimization

https://www.nabo.dev/blogs/kernel-primer
10•nomi_uw•3d ago•0 comments

Show HN: Recalc – Spreadsheet where cells can be Claude Code or Codex terminals

https://github.com/sshah03/recalc
7•sshah03•1d ago•1 comments

On Being an Engineer in 2026

https://twitter.com/shaharglazner/status/2119796029256032278
4•talboren•4h ago•1 comments

Nuance Labs

https://app.nuancelabs.ai/try
4•charlieirish•1h ago•2 comments

Pigshell: Unix the Web

http://pigshell.com/v/0.6.4/
37•pbohun•4h ago•15 comments

Show HN: Someone Was Here – Find out who used your Mac while you were away

https://someonewashere.app/
4•4onthefloor124•41m ago•0 comments

Cryptocurrency lawsuit: Ethereum Foundation required "suicide pledge"

https://www.denverpost.com/2026/11/06/ethereum-suicide-pledge-lawsuit-mandate-boulder-crypto/
112•ceejayoz•4h ago•123 comments

E-means: 10x faster k-means at equal loss

https://e-means.github.io/
3•porridgeraisin•46m ago•0 comments

The Qlobe: Rotating Quine (2010)

http://mamememo.blogspot.com/2010/09/qlobe.html
42•niceguitars•16h ago•2 comments

Fun things to do with your VM/370 CE machine – Fun with big computers

https://rbanffy.github.io/fun-with-big-computers/fun-with-vm370/
91•rbanffy•9h ago•26 comments

Children of Men: The future is a mirror for the present

https://reactormag.com/children-of-men-the-future-is-a-mirror-for-the-present/
110•speckx•6h ago•88 comments

Try Gleam

https://nchagnet.eu/blog/you-should-try-gleam
82•nchagnet•7h ago•98 comments

The Web Is More Than Enough

https://ftrain.com/aboard-the-web-is-more-than-enough
157•edward•23h ago•113 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.