frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Fixing the Portobello Police Station Clock

https://pointinthecloud.com/2026-04-11-211700.html
166•avidly•2h ago•37 comments

28% of job postings on company career sites have been open over 90 days

https://unlisted.careers/ghost-jobs/report/2026-09
43•rubatrejo•49m ago•43 comments

Radicle: Disclosure of Vulnerability in the Network Protocol

https://radicle.dev/2026/09/23/disclosure-of-vulnerability-in-network-protocol
40•lostmsu•2h ago•12 comments

Gemini 3.8 text-to-speech

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-3-8-text-to-speech/
86•swolpers•1h ago•53 comments

Stripe's Knowledge AI Platform

https://stripe.dev/blog/meet-stripes-knowledge-ai-platform
110•ltononro•3h ago•62 comments

Jev in 25 Lines of Python

https://www.nobodywho.ai/posts/jev-in-25-lines/
500•bashbjorn•9h ago•153 comments

Strands Harness

https://strandsagents.com/blog/introducing-strands-harness/
82•zuckerborg0101•2h ago•55 comments

Claude Code reads AGENTS.md only when telemetry is on [fixed]

https://blog.szypowi.cz/p/claude-code-reads-agents.md-only-when-telemetry-is-on/
365•pszypowicz•5h ago•201 comments

GPT-6 Sol and Luna

https://openai.com/index/introducing-gpt-6-sol-and-luna/
1680•OfficialTurkey•23h ago•805 comments

Z80 REPL (2018)

https://abagames.github.io/z80-repl/index.html
110•adunk•6h ago•14 comments

Claude Opus 5.5

https://www.anthropic.com/claude-opus-5-5
1704•km144•1d ago•1040 comments

I don't want the details

https://michaelheap.com/i-dont-want-the-details/
207•mooreds•4h ago•127 comments

Tokens Too Cheap to Meter

https://jyn.dev/tokens-too-cheap-to-meter/
132•teoruiz•8h ago•104 comments

GPT-6 Astra has gained the ability to drive a car

https://drivingbench.com/
167•plurby•2h ago•137 comments

Web-based IBM 1620 emulator and IPL-V from 1963

https://github.com/pkimpel/retro-1620
18•abrax3141•17h ago•4 comments

Seattle City Council votes to ban surveillance pricing in sale of groceries

https://advocacy.consumerreports.org/press_release/seattle-city-council-votes-to-ban-surveillance...
88•ortusdux•3h ago•32 comments

QuestDB (YC S20) Is Hiring a Sales Engineer

https://questdb.com/careers/pre-sales-engineer-north-america/
1•nhourcard•5h ago

OpenAI GPT–6 Astra breaks Enigma message that has resisted solution since 2005

https://www.cryptocellar.org/bgac/the-mvueh-break.html
709•sohkamyung•1d ago•427 comments

Transit rewards

https://waymo.com/blog/2026/09/transit-rewards/
220•raybb•14h ago•279 comments

The GitHub wiki is an anti-pattern (2022)

https://michaelheap.com/github-wiki-is-an-antipattern/
126•ibobev•4h ago•73 comments

What California is learning from solar panels built over irrigation canals

https://www.kqed.org/science/2002033/heres-what-california-is-learning-from-solar-panels-built-ov...
314•Jtsummers•1d ago•613 comments

How did AMD Ryzen get 50% faster in two years?

https://lemire.me/blog/2026/09/18/how-did-amd-ryzen-get-50-faster-in-two-years/
440•ibobev•4d ago•177 comments

Microsoft killed FoxPro in 2007. Anyway, here's FoxPro revived

https://foxscript.org/
427•boredjohnny•20h ago•237 comments

'We hacked the FBI:' Hackers say they have data on all FBI employees

https://www.404media.co/we-hacked-the-fbi-hackers-say-they-have-data-on-all-fbi-employees/
755•spenvo•23h ago•545 comments

ReBarUEFI: Resizable BAR for almost any UEFI system

https://github.com/xCuri0/ReBarUEFI
213•nateb2022•2d ago•66 comments

SAML: A fractal of bad design

https://blog.trailofbits.com/2026/09/21/saml-a-fractal-of-bad-design/
314•aray07•22h ago•164 comments

Data-only attacks are easier than you think (2024)

https://www.usenix.org/publications/loginonline/data-only-attacks-are-easier-you-think
88•segfaultbuserr•13h ago•34 comments

WordPress: Unauthenticated path traversal leading to conditional RCE

https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-7hp8-65ch-5whp
224•vntok•1d ago•123 comments

Pentagon says overreliance on AI contributed to missile strike on Iran school

https://www.bloomberg.com/graphics/2026-iran-school-attack/
841•devonnull•22h ago•450 comments

Claude Opus 5.5 Intelligence, Performance and Price Analysis (Max)

https://artificialanalysis.ai/models/claude-opus-5-5
320•theanonymousone•1d ago•101 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.