frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Shipping JPEG XL in Chrome

https://developer.chrome.com/blog/jpeg-xl-in-chrome
71•AshleysBrain•59m ago•33 comments

A font recreated from photographs of classic Commodore 64 keycaps

https://github.com/szabadkai/c64-keyboard-font/
139•sohkamyung•3h ago•23 comments

Nobel Prize in Chemistry 2026 to Henri B. Kagan and Kenso Soai

https://www.nobelprize.org/prizes/chemistry/2026/press-release/
76•sasvari•2h ago•9 comments

Sharing AI progress in mathematics

https://openai.com/index/sharing-ai-progress-in-mathematics/
998•OfficialTurkey•14h ago•971 comments

Strands Decider 2B: a small, open-source, decision model

https://strandsagents.com/blog/introducing-strands-decider/
213•gmays•10h ago•57 comments

Show HN: AstroHelm – Use your phone camera to aim a telescope or telephoto lens

https://astrohelm.app/
17•HeavenFox•2d ago•9 comments

Decisions API is in public beta

https://developers.openai.com/api/docs/guides/decisions
334•chiefstorm•15h ago•177 comments

ESP32-C3 Adblock

https://github.com/M-Abozaid/esp32-c3-adblock
130•jayhoon•10h ago•51 comments

Mistral Large 4

https://mistral.ai/news/mistral-large-4/\
1878•Philpax•23h ago•1128 comments

EmbeddingGemma 2: An open, lightweight multimodal embedding model

https://blog.google/innovation-and-ai/technology/developers-tools/embeddinggemma-2/
356•ilreb•20h ago•35 comments

What is Codemode

https://lucumr.pocoo.org/2026/10/6/codemode/
106•Tomte•22h ago•48 comments

Shaders, WebGPU Components for React, Vue, Svelte, Solid, JavaScript and Framer

https://github.com/shader-effects-inc/shaders
39•jinqueeny•6h ago•21 comments

Tell HN: GitHub refuses to remove cracked copies of my software after a month

327•IvanK_net•17h ago•178 comments

Gallery of Processor Cache Effects (2010)

https://igoro.com/archive/gallery-of-processor-cache-effects/
23•porridgeraisin•2d ago•4 comments

The cost of lies: A Mineserver story

https://www.jeremyreimer.com/rockets-item.lsp?f=true&p=272
133•luu•3d ago•57 comments

Penguin Mail – open-source Rust email client for Linux with AI

https://penguin-mail.com/
209•kavourias•14h ago•135 comments

Claude Code’s suggested message feature: I think the real customer is the model

https://www.zohaib.cc/blog/smartest-claude-code-feature
224•zed_labs_dev•18h ago•130 comments

Show HN: Arcadeia – A self-hosted media library with animated video previews

https://github.com/travelonium/arcadeia
9•omidontop•2d ago•6 comments

Rust's derive often implies inline

https://yossarian.net/til/post/rust-s-derive-often-implies-inline/
4•woodruffw•3d ago•0 comments

The Legend of the Paper Crane

https://mazdastories.com/en_us/inspire/paper-cranes-into-the-fold/
22•vismit2000•2d ago•9 comments

OpenTPU – An open-source AI accelerator, developed by AI

https://github.com/FeSens/openTPU
304•fsbonetto•20h ago•353 comments

PS5 Jailbreaks Are Escalating at an Unprecedented Pace

https://www.pushsquare.com/news/2026/10/ps5-jailbreaks-are-escalating-at-an-unprecedented-pace-an...
21•password54321•2h ago•13 comments

Forever Junior: The Skills AI Can't Develop for You

https://tech.criteo.com/blog/human-skills-ai-cant-develop-junior-engineers/
11•brugidou•4h ago•3 comments

Show HN: NanoMuse – An open-source AI agent for your phone and computer

https://github.com/nano-muse/nanoMuse
29•ilreb•8h ago•7 comments

La Cueva BBS in Mexico in 1993 (session replay)

https://nanochess.org/la_cueva_bbs.html
57•nanochess•9h ago•17 comments

The art of defusing a second world war bomb

https://www.theguardian.com/news/ng-interactive/2026/oct/06/it-could-knock-a-whole-street-down-th...
83•sandebert•8h ago•57 comments

Treg (OpenRouter for Tools)

https://github.com/superdesigndev/treg
36•trollied•19h ago•8 comments

State of Devs 2026

https://2026.stateofdevs.com/en-US/
201•sgdesign•12h ago•104 comments

Hackers obtain counterfeit TLS certificates for Google and other large services

https://arstechnica.com/security/2026/10/hackers-obtain-counterfeit-tls-certificates-for-google-a...
103•colinprince•7h ago•35 comments

When random is not actually random enough

https://ersc.io/blog/when-random-isnt-random-enough
68•steveklabnik•16h ago•37 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.