frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Gemini 4 Argon

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-4-argon/
1201•bradleyg223•9h ago•780 comments

The top secret URSALA, RAQUEL, and FARRAH satellites (2025)

https://www.thespacereview.com/article/4951/1
184•Bluestein•7h ago•78 comments

Why the Bronze Age Collapsed

https://www.worksinprogress.news/p/why-really-caused-the-bronze-age
152•AnodicElegy•1d ago•81 comments

Surprisingly complex waves reveal the brain's inner workings

https://www.quantamagazine.org/surprisingly-complex-waves-reveal-the-brains-inner-workings-20260930/
158•ibobev•10h ago•51 comments

EDG C++ front-end goes public

https://edgcpp.org/#transition
191•iandinwoodie•10h ago•85 comments

Launch HN: Magnitude (YC S25) – Self-optimizing inference engine for agents

https://github.com/magnitudedev/magnitude
142•anerli•12h ago•69 comments

Halfspace experimental IDE for solid modeling with distance fields

https://www.mattkeeter.com/projects/halfspace/
106•luu•9h ago•9 comments

A brief history of the Bloomberg terminal

https://spectrum.ieee.org/bloomberg-terminal
250•rbanffy•15h ago•106 comments

Before pixels: Modular industrial dashboards

https://unsung.aresluna.org/before-pixels-modular-industrial-dashboards/
82•leephillips•10h ago•13 comments

Show HN: Yantra – an LALR(1) parser generator for C++

https://github.com/TantrixAuto/yantra
19•renjipanicker•3h ago•9 comments

Singapore govt dating app uses Gale-Shapley stable marriage algorithm

https://twitter.com/tuakdotsol/status/2105105417760391258
306•rzk•20h ago•244 comments

TUI Games in 80x24

https://www.incredible.rs/#blog/tui-games-in-80x24.md
6•incrediblers•1d ago•7 comments

5x faster Edge Functions: V8 isolates to Firecracker MicroVMs

https://www.netlify.com/blog/edge-functions-firecracker-microvms/
141•jbott•11h ago•54 comments

CHOMPI portable sampler instrument is now open-source (hardware and software)

https://www.chompiclub.com/opensource
68•lashkari•11h ago•14 comments

I could've accessed 17T Microsoft records

https://blog.faav.net/how-i-couldve-accessed-17-trillion-microsoft-records
283•luispa•2d ago•117 comments

56k.rip – the 1996 dial-up internet experience

https://56k.rip/
132•adunk•7h ago•71 comments

Show HN: Ledge.sh – Runnable Markdown Notes

https://ledge.sh
89•dancablam•1d ago•43 comments

Is sandboxing sufficient to contain rogue agents?

https://blog.cryptographyengineering.com/2026/09/30/is-sandboxing-sufficient-to-contain-rogue-age...
4•zdw•2h ago•0 comments

Doing a Machine Learning PhD While Working in Japan

https://www.tokyodev.com/articles/doing-a-machine-learning-phd-while-working-in-japan
74•pwim•22h ago•25 comments

Great Dirhombicosidodecahedron ("Miller's Monster")

https://www.software3d.com/MillersMonster.php
58•cobbzilla•12h ago•5 comments

What TLA+ can and can't check

https://buttondown.com/hillelwayne/archive/what-tla-can-and-cant-check/
166•b-man•15h ago•36 comments

The last time my family was replaced by technology

https://manuel.darcemont.fr/posts/the-last-time-my-family-was-replaced-by-technology/
210•megalomanu•16h ago•457 comments

Burning Man death rates – A short lesson in statistics

https://ihavenapkinthoughts.substack.com/p/burning-man-death-rates-a-short-lesson
123•viraj_shah•2d ago•153 comments

Coltrane's Tone Circle

https://jtomschroeder.com/blog/tone-circle/
46•jtomschroeder•14h ago•16 comments

Responsible Release of AI-Generated Mathematics

https://agmai.org/general-sep29/
85•aureianimus•1d ago•106 comments

PlayBook: A Programmable Paper Notebook [video]

https://www.youtube.com/watch?v=GurWDZ8ENpA
6•surprisetalk•1d ago•0 comments

Functional Ultrasound Imaging (fUSI) from scratch

https://www.neuroai.science/p/functional-ultrasound-imaging-from
37•pminimax•9h ago•7 comments

SDF Public Access Unix System ... est. 1987

https://sdf.org/
85•kmstout•15h ago•19 comments

Bild AI (YC W25) Is Hiring a Founding Product Engineer

https://www.ycombinator.com/companies/bild-ai/jobs/dAbC3Gd-founding-product-engineer
1•rooppal•12h ago

SDF vs. MSDF vs. Slug: GPU Text Rendering

https://alphapixeldev.com/sdf-vs-msdf-vs-slug-vs-rive-gpu-text-rendering/
143•ibobev•15h ago•56 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.