frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

How I almost found the eMudhra d=4 Private Key

https://blog.hboeck.de/archives/910-How-I-almost-found-the-eMudhra-d4-Private-Key.html
103•hannob•2h ago•23 comments

Keeping HTTPS Connections Safe in Chrome

https://blog.google/security/keeping-https-connections-safe-in-chrome/
277•arwt•6h ago•152 comments

An OS with no threads: The Actor Model

https://www.timdbg.com/posts/dbgos-actor-model/
44•ingve•1h ago•11 comments

Avoiding embarrassment is getting expensive

https://tornikeo.com/avoiding-embarrassment/
93•tornikeo•3h ago•47 comments

I quit big tech to build with AI

https://drawsolve.com/blog/building-with-ai
625•James_Stryker_D•10h ago•301 comments

Memtest86+ v9.10 adds NUMA support for multi-socket servers

https://github.com/memtest86plus/memtest86plus/releases/tag/v9.10
102•FiderHi•7h ago•3 comments

How far behind are open-weight models?

https://sebastianraschka.com/blog/2026/how-far-behind-are-open-weight-models.html
683•ModelForge•19h ago•546 comments

Rex is now available to everyone

https://www.superlogical.com/updates/rex-available-to-everyone
899•kylebarron•18h ago•303 comments

Intellectual Debt After Generative AI

https://www.noemamag.com/intellectual-debt-after-generative-ai/
188•theanonymousone•4h ago•165 comments

Unmodified 748B DeepSeek-v4.1-Flash on one RTX 4090

https://axel-labs.com/research/deepseek-v4-1-flash-on-one-rtx-4090
346•bobbitybobob•14h ago•73 comments

Future of Software Is Open Source

https://bexx.io/post/future-of-software-is-open-source/
110•bexxmodd•4h ago•78 comments

Cloudflare will be fully post-quantum in 2027

https://blog.cloudflare.com/project-quantum-leap/
866•jupenur•23h ago•429 comments

Qwen4-35B-A3B

https://huggingface.co/Qwen/Qwen4-35B-A3B
751•Philpax•9h ago•168 comments

Post-quantum key exchange in Tailscale v1.106

https://tailscale.com/blog/pqc-key-exchange
446•tatersolid•16h ago•78 comments

MiniMax-M4, an open-weight, natively multimodal Mixture-of-Experts model

https://github.com/MiniMax-AI/MiniMax-M4
513•cmrdporcupine•19h ago•174 comments

Laravel for COBOL

https://github.com/pihedy/laravel-cobol
445•choult•18h ago•154 comments

Prelude 9B open European model

https://openeurollm.eu/blog/prelude-announcement
908•magru•17h ago•233 comments

Am I a developer or just a good Googler? (2013)

https://www.hanselman.com/blog/am-i-really-a-developer-or-just-a-good-googler
97•bariumbitmap•9h ago•40 comments

Man hooks up his 1994 Jeep Cherokee to ChatGPT

https://www.thedrive.com/news/man-hooks-up-his-1994-jeep-cherokee-to-chatgpt-and-the-results-are-...
231•thehoff•1d ago•121 comments

Launching S3 Wormhole

https://www.daemonology.net/blog/2026-12-02-Launching-S3-Wormhole.html
217•lewww•1d ago•60 comments

How to hard-fork to save most funds in a quantum emergency (2024)

https://ethresear.ch/t/how-to-hard-fork-to-save-most-users-funds-in-a-quantum-emergency/18901
172•olaird25•15h ago•68 comments

Plain Text Accounting

https://plaintextaccounting.org/
30•saikatsg•6h ago•3 comments

OpenAI Is Struggling to Raise Capital: "Air has come out of the bubble"

https://futurism.com/artificial-intelligence/openai-financial-trouble
238•ryan_j_naughton•7h ago•200 comments

Show HN: Custom X64-86 Operating System Written from Scratch

https://github.com/adriantips/boltossource
46•adrianbyte•1d ago•21 comments

Fingerprinting Chess Players by Their Move Timings

https://healeycodes.com/fingerprinting-chess-players-by-their-move-timings
136•healeycodes•19h ago•43 comments

Flux 3.1 Image

https://bfl.ai/blog/flux-3-1
160•leumon•16h ago•49 comments

Honeypots that hack the hacking agent back

https://github.com/NebuSec/ArtexPot
104•_____k•14h ago•26 comments

Jensen Huang’s defiant approach during appearance before Senate committee

https://www.politico.com/news/2026/12/03/jensen-huang-senate-testimony-01192031
242•JumpCrisscross•12h ago•678 comments

macOS 27.3: New "Accessibility" Permission Warning

https://wojciechkulik.pl/blog/macos-27-3-new-accessibility-permission-warning-is-beyond-ridiculous/
316•latexr•13h ago•229 comments

Steller's sea cow: First historical extinction of a marine mammal at human hands

https://www.nhm.ac.uk/discover/stellers-sea-cow-first-historical-extinction-of-marine-mammal-at-h...
188•zeristor•3d ago•64 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.