frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Checkout.com hacked, refuses ransom payment, donates to security labs

https://www.checkout.com/blog/protecting-our-merchants-standing-up-to-extortion
111•StrangeSound•2h ago•64 comments

Google will allow users to sideload Android apps without verification

https://android-developers.googleblog.com/2025/11/android-developer-verification-early.html
1034•erohead•11h ago•444 comments

Steam Machine

https://store.steampowered.com/sale/steammachine
2118•davikr•17h ago•978 comments

Steam Frame

https://store.steampowered.com/sale/steamframe
1539•Philpax•17h ago•567 comments

Android 16 QPR1 is being pushed to the Android Open Source Project

https://grapheneos.social/@GrapheneOS/115533432439509433
137•uneven9434•7h ago•45 comments

The last-ever penny will be minted today in Philadelphia

https://www.cnn.com/2025/11/12/business/last-penny-minted
686•andrewl•19h ago•841 comments

Human Fovea Detector

https://www.shadertoy.com/view/4dsXzM
218•AbuAssar•10h ago•54 comments

Continuous Autoregressive Language Models

https://arxiv.org/abs/2510.27688
35•Anon84•1w ago•4 comments

Transpiler, a Meaningless Word (2023)

https://people.csail.mit.edu/rachit/post/transpiler/
56•jumploops•6d ago•33 comments

GPT-5.1: A smarter, more conversational ChatGPT

https://openai.com/index/gpt-5-1/
381•tedsanders•16h ago•438 comments

Telli (Voice AI – YC F24) is hiring ambitious engineers in [on-site, Berlin]

https://hi.telli.com/eng
1•sebselassie•2h ago

Project Euler

https://projecteuler.net
465•swatson741•18h ago•118 comments

Reverse Engineering Yaesu FT-70D Firmware Encryption

https://landaire.net/reversing-yaesu-firmware-encryption/
27•austinallegro•4h ago•4 comments

Seed. LINE's Custom Typeface

https://seed.line.me/index_en.html
7•totetsu•2h ago•1 comments

Valve is about to win the console generation

https://xeiaso.net/blog/2025/valve-is-about-to-win-the-console-generation/
338•moonleay•12h ago•262 comments

Mergiraf: Syntax-Aware Merging for Git

https://lwn.net/SubscriberLink/1042355/434ad706cc594276/
94•Velocifyer•1w ago•25 comments

Marble: A Multimodal World Model

https://www.worldlabs.ai/blog/marble-world-model
210•meetpateltech•13h ago•54 comments

Fighting the New York Times' invasion of user privacy

https://openai.com/index/fighting-nyt-user-privacy-invasion
358•meetpateltech•21h ago•308 comments

Strap Rail

https://www.construction-physics.com/p/strap-rail
17•surprisetalk•3d ago•1 comments

GLP-1 drugs linked to lower death rates in colon cancer patients

https://today.ucsd.edu/story/glp-1-drugs-linked-to-dramatically-lower-death-rates-in-colon-cancer...
154•gmays•15h ago•136 comments

Learn Prolog Now

https://lpn.swi-prolog.org/lpnpage.php?pageid=top
296•rramadass•20h ago•196 comments

Homebrew no longer allows bypassing Gatekeeper for unsigned/unnotarized software

https://github.com/Homebrew/brew/issues/20755
238•firexcy•13h ago•189 comments

Helm 4.0

https://github.com/helm/helm/releases/tag/v4.0.0
99•todsacerdoti•18h ago•103 comments

Meta replaces WhatsApp for Windows with web wrapper that uses 1 GB RAM when idle

https://www.windowslatest.com/2025/11/12/meta-just-killed-native-whatsapp-on-windows-11-now-it-op...
308•DearAll•8h ago•249 comments

Yt-dlp: External JavaScript runtime now required for full YouTube support

https://github.com/yt-dlp/yt-dlp/issues/15012
984•bertman•1d ago•574 comments

A Commentary on the Sixth Edition Unix Operating System

https://warsus.github.io/lions-/
39•o4c•8h ago•8 comments

Digital ID, a new way to create and present an ID in Apple Wallet

https://www.apple.com/newsroom/2025/11/apple-introduces-digital-id-a-new-way-to-create-and-presen...
118•meetpateltech•19h ago•149 comments

LED types by Color, Brightness, and Chemistry (2021)

https://donklipstein.com/ledc.html
9•Lammy•1w ago•3 comments

On USB HID, Keyboard LEDs, and device emulation (2024)

https://epsilon537.github.io/boxlambda/usb-hid/
30•transpute•8h ago•1 comments

Launch HN: JSX Tool (YC F25) – A Browser Dev-Panel IDE for React

99•jsunderland323•18h ago•75 comments
Open in hackernews

Comparing floating-point numbers (2012)

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

Comments

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