frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

If you put Apple icons in reverse it looks like someone getting good at design

https://www.threads.com/@heliographe.studio/post/DTeOwAykwQ1
134•lateforwork•2h ago•59 comments

A programming language based on grammatical cases of Turkish

https://github.com/kip-dili/kip
122•nhatcher•5h ago•40 comments

ASCII characters are not pixels: a deep dive into ASCII rendering

https://alexharri.com/blog/ascii-rendering
830•alexharri•14h ago•102 comments

Xous Operating System

https://xous.dev/
71•eustoria•3d ago•21 comments

We put Claude Code in Rollercoaster Tycoon

https://labs.ramp.com/rct
363•iamwil•5d ago•207 comments

Show HN: ChunkHound, a local-first tool for understanding large codebases

https://github.com/chunkhound/chunkhound
46•NadavBenItzhak•4h ago•5 comments

The recurring dream of replacing developers

https://www.caimito.net/en/blog/2025/12/07/the-recurring-dream-of-replacing-developers.html
281•glimshe•11h ago•232 comments

Light Mode InFFFFFFlation

https://willhbr.net/2025/10/20/light-mode-infffffflation/
142•Fudgel•3h ago•102 comments

The Olivetti Company

https://www.abortretry.fail/p/the-olivetti-company
140•rbanffy•6d ago•24 comments

Raising money fucked me up

https://blog.yakkomajuri.com/blog/raising-money-fucked-me-up
120•yakkomajuri•7h ago•38 comments

An Elizabethan mansion's secrets for staying warm

https://www.bbc.com/future/article/20260116-an-elizabethan-mansions-secrets-for-staying-warm
114•Tachyooon•9h ago•133 comments

Below the Surface: Archeological Finds from the Amsterdam Noord/Zuid Metro Line

https://belowthesurface.amsterdam/en/vondsten
60•stefanvdw1•6d ago•8 comments

MIT's Computer Systems Security (2024)

https://css.csail.mit.edu/6.858/2024/
5•barishnamazov•1h ago•1 comments

M8SBC-486 (Homebrew 486 computer)

https://maniek86.xyz/projects/m8sbc_486.php
89•rasz•6d ago•8 comments

The thing that brought me joy

https://www.stephenlewis.me/blog/the-thing-that-brought-me-joy/
62•monooso•7h ago•24 comments

Common misunderstandings about large software companies

https://philipotoole.com/common-misunderstandings-about-large-software-companies/
66•otoolep•5d ago•36 comments

Counterfactual evaluation for recommendation systems

https://eugeneyan.com/writing/counterfactual-evaluation/
61•kurinikku•20h ago•4 comments

There's no single best way to store information

https://www.quantamagazine.org/why-theres-no-single-best-way-to-store-information-20260116/
75•7777777phil•9h ago•43 comments

IRISC: An ARMv7 assembly interpreter and computer architecture simulator

https://polysoftit.co.uk/irisc-web/
9•rtybanana•1h ago•1 comments

A New Era for FIRST LEGO League: Inspiring the Next Generation of Learners

https://community.firstinspires.org/new-era-first-lego-league-future-edition
3•jchin•5d ago•1 comments

What are Tithe Maps (2021)

https://mapreading.co.uk/what-are-tithe-maps/
14•thomasjb•5d ago•1 comments

Map To Poster – Create Art of your favourite city

https://github.com/originalankur/maptoposter
224•originalankur•15h ago•58 comments

ClickHouse acquires Langfuse

https://langfuse.com/blog/joining-clickhouse
195•tin7in•16h ago•91 comments

The Dilbert Afterlife

https://www.astralcodexten.com/p/the-dilbert-afterlife
451•rendall•1d ago•289 comments

Show HN: Streaming gigabyte medical images from S3 without downloading them

https://github.com/PABannier/WSIStreamer
135•el_pa_b•17h ago•44 comments

Docker.how – Docker command cheat sheet

https://docker.how/
45•anagogistis•5h ago•12 comments

6-Day and IP Address Certificates Are Generally Available

https://letsencrypt.org/2026/01/15/6day-and-ip-general-availability
488•jaas•1d ago•271 comments

Reducing Dependabot Noise

https://nesbitt.io/2026/01/10/16-best-practices-for-reducing-dependabot-noise.html
57•zdw•5d ago•38 comments

High-Level Is the Goal

https://bvisness.me/high-level/
242•tobr•2d ago•122 comments

OpenAI could reportedly run out of cash by mid-2027

https://www.tomshardware.com/tech-industry/big-tech/openai-could-reportedly-run-out-of-cash-by-mi...
63•thenaturalist•2h ago•49 comments
Open in hackernews

Comparing floating-point numbers (2012)

https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
26•sph•8mo ago

Comments

LegionMammal978•8mo 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•8mo 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•8mo 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.