frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Statistical Process Control in Python

https://timothyfraser.com/sigma/statistical-process-control-in-python.html
91•lifeisstillgood•5h ago•22 comments

A cell so minimal that it challenges definitions of life

https://www.quantamagazine.org/a-cell-so-minimal-that-it-challenges-definitions-of-life-20251124/
39•ibobev•3h ago•14 comments

Kagi Hub Belgrade

https://blog.kagi.com/kagi-hub
53•_se•1h ago•37 comments

Is DWPD Still a Useful SSD Spec?

https://klarasystems.com/articles/is-dwpd-still-useful-ssd-spec/
11•zdw•4d ago•6 comments

I don't care how well your "AI" works

https://fokus.cool/2025/11/25/i-dont-care-how-well-your-ai-works.html
99•todsacerdoti•3h ago•130 comments

Show HN: KiDoom – Running DOOM on PCB Traces

https://www.mikeayles.com/#kidoom
278•mikeayles•15h ago•34 comments

Image Diffusion Models Exhibit Emergent Temporal Propagation in Videos

https://arxiv.org/abs/2511.19936
49•50kIters•5h ago•9 comments

Surprisingly, Emacs on Android is pretty good

https://kristofferbalintona.me/posts/202505291438/
170•harryday•3d ago•80 comments

Efficient solar cooking that stores heat in sand

https://www.sciencedirect.com/science/article/pii/S266711312500035X
30•gsf_emergency_6•2d ago•13 comments

Cekura (YC F24) Is Hiring

https://www.ycombinator.com/companies/cekura-ai/jobs/0ZGLW69-forward-deployed-engineer-us
1•atarus•1h ago

Copyparty, the FOSS file server [video]

https://www.youtube.com/watch?v=15_-hgsX2V0
115•franczesko•6d ago•24 comments

Space Truckin' – The Nostromo (2012)

https://alienseries.wordpress.com/2012/10/23/space-truckin-the-nostromo/
120•exvi•11h ago•64 comments

Trillions spent and big software projects are still failing

https://spectrum.ieee.org/it-management-software-failures
514•pseudolus•1d ago•450 comments

A new bridge links the math of infinity to computer science

https://www.quantamagazine.org/a-new-bridge-links-the-strange-math-of-infinity-to-computer-scienc...
204•digital55•17h ago•105 comments

1,700-year-old Roman sarcophagus is unearthed in Budapest

https://apnews.com/article/hungary-roman-sarcophagus-discovery-budapest-77a41fe190bbcc167b43d0514...
101•gmays•1d ago•57 comments

Jakarta is now the biggest city in the world

https://www.axios.com/2025/11/24/jakarta-tokyo-worlds-biggest-city-population
350•skx001•1d ago•277 comments

Show HN: We built an open source, zero webhooks payment processor

https://github.com/flowglad/flowglad
329•agreeahmed•20h ago•189 comments

How to repurpose your old phone into a web server

https://far.computer/how-to/
268•louismerlin•3d ago•99 comments

CS234: Reinforcement Learning Winter 2025

https://web.stanford.edu/class/cs234/
138•jonbaer•13h ago•20 comments

Launch HN: Onyx (YC W24) – Open-source chat UI

207•Weves•23h ago•138 comments

FLUX.2: Frontier Visual Intelligence

https://bfl.ai/blog/flux-2
326•meetpateltech•22h ago•94 comments

Largest-Triangle-Three-Buckets and the Fourier Transform (2024)

https://daniel.mitterdorfer.name/posts/2024-01-30-downsampling-lttb-and-fft/
17•wonger_•4d ago•3 comments

Java Decompiler

http://java-decompiler.github.io
91•mooreds•3d ago•41 comments

New layouts with CSS Subgrid

https://www.joshwcomeau.com/css/subgrid/
248•joshwcomeau•21h ago•74 comments

BebboSSH: SSH2 implementation for Amiga systems (68000, GPLv3)

https://franke.ms/git/bebbo/bebbossh
46•snvzz•11h ago•12 comments

I DM'd a Korean Presidential Candidate – and Ended Up Building His Core Campaign

https://medium.com/@wjsdj2008/i-dmd-a-korean-presidential-candidate-and-ended-up-building-his-cor...
3•wjsdj2009•9m ago•0 comments

Google Antigravity exfiltrates data via indirect prompt injection attack

https://www.promptarmor.com/resources/google-antigravity-exfiltrates-data
705•jjmaxwell4•19h ago•188 comments

Python is not a great language for data science

https://blog.genesmindsmachines.com/p/python-is-not-a-great-language-for
274•speckx•21h ago•260 comments

Ilya Sutskever: We're moving from the age of scaling to the age of research

https://www.dwarkesh.com/p/ilya-sutskever-2
351•piotrgrabowski•20h ago•297 comments

Constant-time support coming to LLVM: Protecting cryptographic code

https://blog.trailofbits.com/2025/11/25/constant-time-support-coming-to-llvm-protecting-cryptogra...
94•ahlCVA•1d ago•41 comments
Open in hackernews

Comparing floating-point numbers (2012)

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

Comments

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