frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Denmark Data Breach Exposes 8.8M People's Personal Data

https://www.cpr.dk/cpr-nyt/nyhedsarkiv/2026/okt/omfattende-uautoriseret-adgang-til-borgeres-cpr-o...
121•clan•2h ago•75 comments

Huawei and Qualcomm Announce Broad Patent License Agreement

https://www.huawei.com/en/news/2026/10/qualcomm-broad-patent-agreement
67•0xedb•2h ago•42 comments

Run Qwen 3.8 Flash Next (125B) on consumer hardware (RTX 4090) at 100T/s

https://github.com/Niko1221/Strata
812•snehesht•21h ago•358 comments

Apple and a Hacker's Future

https://stratechery.com/2026/apple-and-a-hackers-future/
3•maguay•27m ago•0 comments

In the wake of Tippett Studios’ closure, a digital archive appears online

https://filmstories.co.uk/news/tippett-studios-in-the-wake-of-its-closure-a-digital-archive-of-an...
144•rdmuser•13h ago•17 comments

We ported the original Doom to SQL

https://cedardb.com/blog/sqldoom/
125•Vaslo•1d ago•16 comments

A browser-native classic Visual Basic VB6 IDE

https://wieslawsoltes.github.io/VB6/
249•wiso•15h ago•86 comments

Infidel goes wild

https://blog.zarfhome.com/2026/10/infidel-goes-wild
140•tobr•1d ago•23 comments

The Tao of Backup

http://www.taobackup.com/index.html
146•vntok•2d ago•50 comments

Gods in the Classroom: Religion and Education in First Millennium BCE Babylonia

https://www.cambridge.org/core/journals/iraq/article/gods-in-the-classroom-religion-and-education...
39•pseudolus•3d ago•12 comments

First Implantable Cochlear Implant Launches

https://spectrum.ieee.org/fully-implantable-cochlear-implant
11•rbanffy•3d ago•4 comments

Replacement of petroleum based products with plant-based materials (2025)

https://onlinelibrary.wiley.com/doi/10.1002/eng2.70108
69•thelastgallon•5h ago•33 comments

Turn off Apple Intelligence on macOS 27 and get its disk space back

https://github.com/omlahore/RemoveMacAI
587•privacyisntdead•14h ago•402 comments

Tell HN: Bob Cringely has died

878•paveworld•1d ago•189 comments

Safe Optimistic Lock Coupling

http://databasearchitects.blogspot.com/2026/04/safe-optimistic-lock-coupling.html
20•greghn•3d ago•0 comments

Demystifying Tufte's data-ink ratio

https://tuftesrazor.scienceux.org/
51•s4074433•2d ago•19 comments

Powerless F1 drivers frustrated by Bahrain F1 software glitch

https://www.motorsport.com/f1/news/horrible-totally-unacceptable-powerless-f1-drivers-frustrated-...
211•llm_nerd•8h ago•179 comments

Automating my 35mm film scanning pipeline

https://shannadige.com/blog/darkroom/
79•shannadige•1d ago•57 comments

Improper redaction reveals Google Data Center water and electricity usage

https://www.1011now.com/2026/09/30/more-questions-than-answers-about-lincolns-google-data-center-...
398•sensanaty•14h ago•521 comments

Decision models like Jev don't beat LLM-as-a-judge or traditional classifiers

https://developers.redhat.com/articles/2026/10/02/benchmarking-ai-decision-models-against-traditi...
72•tomncooper•2d ago•20 comments

Lace and Labor: Lessons from the actual Luddites

https://articlesofinterest.substack.com/p/lace-and-labor
23•surprisetalk•4d ago•1 comments

What is going on with ceiling fans

https://mcmansionhell.com/post/829127919552151552/what-is-going-on-with-ceiling-fans
316•colinprince•4d ago•268 comments

'Neanderthals Among Us' review

https://www.historytoday.com/archive/review/neanderthals-among-us-peter-sahlins-review
77•pepys•1d ago•78 comments

Show HN: Glashütte Trash Clock – A 30-minute pendulum clock made from trash

https://niklasroy.com/gtc/
200•r0r0•3d ago•30 comments

Watson Jr. memo about CDC 6600 (1963)

https://www.computerhistory.org/revolution/supercomputers/10/33/62
44•mooreds•1d ago•23 comments

Bill Draper has died

https://www.nytimes.com/2026/09/30/technology/william-draper-dead.html
122•bookofjoe•22h ago•38 comments

Self-hosted HTTP tunnels with SSH and Nginx

https://vincent.bernat.ch/en/blog/2026-http-over-ssh
143•renehsz•12h ago•32 comments

How to scale intent, quality, and artistry with AI [video]

https://www.youtube.com/watch?v=GLvFTMtw4Jk
86•simonjgreen•1d ago•32 comments

Interview with Chicken Scheme Maintainer Sjamaan/Peter Bex

https://alexalejandre.com/interviews/peter-bex/
44•veqq•2d ago•11 comments

Why don't more developers “use the platform”?

https://nolanlawson.com/2026/10/03/why-dont-more-developers-use-the-platform/
304•vinhnx•1d ago•318 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.