<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: nayuki</title><link>https://news.ycombinator.com/user?id=nayuki</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Tue, 14 Apr 2026 22:56:51 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=nayuki" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by nayuki in "Floating point from scratch: Hard Mode"]]></title><description><![CDATA[
<p>When people see that binary-float-64 causes 0.1 + 0.2 != 0.3, the immediate instinct is to reach for decimal arithmetic. And then they claim that you must use decimal arithmetic for financial calculations. I would rate these statements as half-true at best. Yes, 0.1 + 0.2 = 0.3 using decimal floating-point or fixed-point arithmetic, and yes, it's bad accounting practice when summing a bunch of items and getting a total that differs from the true answer.<p>But decimal floats fall short in subtle ways. Here is the simplest example - sales tax. In Ontario it's 13%. If you buy two items for $0.98 each, the tax on each is $0.1274. There is no legal, interoperable mechanism to charge the customer a fractional number of cents, so you just can't do that. If you are in charge of producing an invoice, you have to decide where to perform the rounding(s). You can round the tax on each item, which is $0.13 each, so the total is ($0.98 + $0.13) × 2 = $2.22. Or you can add up all the pre-tax items ($1.98) and calculate the tax ($0.2548) and round that ($0.25), which brings the total to $0.98×2 + $0.25 = $2.21, a different amount. Not only do you have to decide where to perform rounding(s), you also have to keep track of how many extra decimal places you need. Massachusetts's sales tax is 6.25%, so that's two more decimal places. If you have discounts like "25% off", now you have another phenomenon that can introduce extra decimal places.<p>If you do any kind of interest calculation, you will necessarily have decimal places exploding. The simplest example is to take $100 at 10% annual interest compounded annually, which will give you $110, $121, $133.1, $146.41, $161.051, $177.1561, etc., and you will need to round eventually. Or another example is, 10% annual interest, but computed daily (so 10%/365 per day) and added to the account at the end of the month - not only is 10%/365 inexact in decimal arithmetic, but also many decimal places will be generated in the tiny interest calculations per day.<p>If you do anything that philosophically uses "real numbers", then decimal FP has zero advantages compared to binary FP. If you use pow(), exp(), cos(), sin(), etc. for engineering calculations, continuous interest, physics modeling, describing objects in 3D scene, etc., there will necessarily be all sorts of rational, irrational, and transcendental numbers flying around, and they will have to be approximated in one way or another.</p>
]]></description><pubDate>Tue, 07 Apr 2026 21:09:47 +0000</pubDate><link>https://news.ycombinator.com/item?id=47681408</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47681408</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47681408</guid></item><item><title><![CDATA[New comment by nayuki in "Good Taste the Only Real Moat Left"]]></title><description><![CDATA[
<p>Reminds me of PG's classic essay, "Taste for Makers" (2002): <a href="https://paulgraham.com/taste.html" rel="nofollow">https://paulgraham.com/taste.html</a></p>
]]></description><pubDate>Tue, 07 Apr 2026 16:52:31 +0000</pubDate><link>https://news.ycombinator.com/item?id=47678168</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47678168</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47678168</guid></item><item><title><![CDATA[New comment by nayuki in "AI may be making us think and write more alike"]]></title><description><![CDATA[
<p>> AI may be making us think and write more alike<p>Many technologies have been doing that for centuries. For example: The printing press making books available to the masses, standardized spelling in English (it was a mess before!), radio and TV broadcasting speech thus creating more uniform accents nationwide, the Internet spreading all kinds of information globally instantly, even memes (literally thinking and writing alike).</p>
]]></description><pubDate>Tue, 07 Apr 2026 16:39:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=47677980</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47677980</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47677980</guid></item><item><title><![CDATA[New comment by nayuki in "Floating point from scratch: Hard Mode"]]></title><description><![CDATA[
<p>Well, that escalated quickly. From skimming the first few screenfuls of the page, I thought it was going to be about a beginner programmer's first time dissecting the low-level bit structure of floating-point numbers and implementing some of the arithmetic and logic from scratch using integer operations.<p>And then she writes about logic cells, hardware pipeline architectures, RTL (register-transfer level), ASIC floorplans, and tapeout. Building hardware is hard, as iteration cycles are long and fabricating stuff costs real money. That was quite a journey.<p>Her "about" page adds more context that helps everything make sense:<p>> Professionally, I have a Masters in Electrical and Computer Engineering, have previously worked as a CPU designer at ARM and an FPGA engineer at Optiver. -- <a href="https://essenceia.github.io/about/" rel="nofollow">https://essenceia.github.io/about/</a></p>
]]></description><pubDate>Tue, 07 Apr 2026 16:32:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=47677863</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47677863</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47677863</guid></item><item><title><![CDATA[New comment by nayuki in "SSH certificates: the better SSH experience"]]></title><description><![CDATA[
<p>Zscaler was deployed on a Windows 11 machine at a place that a friend worked at. When I assessed the software, its behavior was downright evil like malware. As we all know, it injects its own root certificate into the operating system in order to conduct man-in-the-middle attacks on TLS/HTTPS connections to monitor the user's web activity.<p>Furthermore, it locks down the web browser's settings so that you cannot use a proxy server to bypass Zscaler's MITM. I saw this behavior in Mozilla Firefox, where the proxy option is set to "No proxy" and all other options are disabled and grayed out; I imagine that it does the same to Google Chrome. If you try to modify the browser's .ini(?) file for proxy settings, Zscaler immediately overwrites it against your will. Zscaler worked very hard to enforce its settings in order to spy on the computer user.<p>And as you'd expect, if you open up the Zscaler GUI in the system tray, you are presented with the option to disable the software if you have the IT password. Which of course, you don't have. Then again, that might be an epsilon better than the Cybereason antivirus software, which just has a system tray icon with no exit option, and cannot be killed in Task Manager even if you are a local administrator, and imposes a heavy slowdown if you're open hundreds of small text files per second.</p>
]]></description><pubDate>Fri, 03 Apr 2026 18:36:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=47630331</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47630331</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47630331</guid></item><item><title><![CDATA[New comment by nayuki in "RSA and Python"]]></title><description><![CDATA[
<p>I have a different take on the same topic: <a href="https://www.nayuki.io/page/java-biginteger-was-made-for-rsa-cryptography" rel="nofollow">https://www.nayuki.io/page/java-biginteger-was-made-for-rsa-...</a><p>My article isn't written as a step-by-step tutorial and doesn't come with example numbers. But mine fills in certain things that xnacly doesn't cover: random prime generation, efficiently calculating the decryption exponent d from (n, e) by using a modular inverse, using modular exponentiation instead of power-then-modulo.<p>By the way for Python, modular exponentiation is pow(x, y, m) (since 3.0), and modular inverse is pow(x, -1, m) (since 3.8, Oct 2019). <a href="https://docs.python.org/3/library/functions.html#pow" rel="nofollow">https://docs.python.org/3/library/functions.html#pow</a></p>
]]></description><pubDate>Sat, 28 Mar 2026 18:34:32 +0000</pubDate><link>https://news.ycombinator.com/item?id=47557142</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47557142</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47557142</guid></item><item><title><![CDATA[New comment by nayuki in "Hold on to Your Hardware"]]></title><description><![CDATA[
<p>> Most consumers are using laptops and laptops are not keeping pace with where the frontier is in a singular compute node. Laptops are increasingly just clients for someone else's compute that you rent, or buy a time slice with your eyeballs, much like smartphones pretty much always have been.<p>It really feels like we're slowly marching back to the era of mainframe computers and dumb terminals. Maybe the democratization of hardware was a temporary aberration.</p>
]]></description><pubDate>Fri, 27 Mar 2026 17:06:29 +0000</pubDate><link>https://news.ycombinator.com/item?id=47545367</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47545367</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47545367</guid></item><item><title><![CDATA[New comment by nayuki in "Gzip decompression in 250 lines of Rust"]]></title><description><![CDATA[
<p>True. A most basic CRC implementation is about 7 lines of code: (presented in Java to avoid some C/C++ footguns)<p><pre><code>    int crc32(byte[] data) {
        int crc = ~0;
        for (byte b : data) {
            crc ^= b & 0xFF;
            for (int i = 0; i < 8; i++)
                crc = (crc >>> 1) ^ ((crc & 1) * 0xEDB88320);
        }
        return ~crc;
    }
</code></pre>
Or smooshed down slightly (with caveats):<p><pre><code>    int crc32(byte[] data) {
        int crc = ~0;
        for (int i = 0; i < data.length * 8; i++) {
            crc ^= (data[i / 8] >> (i % 8)) & 1;
            crc = (crc >>> 1) ^ ((crc & 1) * 0xEDB88320);
        }
        return ~crc;
    }
</code></pre>
But one reason that many CRC implementations are large is because they include a pre-computed table of 256× 32-bit constants so that one byte can processed at a time. For example: <a href="https://github.com/madler/zlib/blob/7cdaaa09095e9266dee21314599a9258db53685e/crc32.h" rel="nofollow">https://github.com/madler/zlib/blob/7cdaaa09095e9266dee21314...</a></p>
]]></description><pubDate>Fri, 27 Mar 2026 15:45:07 +0000</pubDate><link>https://news.ycombinator.com/item?id=47544204</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47544204</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47544204</guid></item><item><title><![CDATA[New comment by nayuki in "Gzip decompression in 250 lines of Rust"]]></title><description><![CDATA[
<p>Just like that author, many years ago, I went through the process of understanding the DEFLATE compression standard and producing a short and concise decompressor for gzip+DEFLATE. Here are the resources I published as a result of that exploration:<p>* <a href="https://www.nayuki.io/page/deflate-specification-v1-3-html" rel="nofollow">https://www.nayuki.io/page/deflate-specification-v1-3-html</a><p>* <a href="https://www.nayuki.io/page/simple-deflate-decompressor" rel="nofollow">https://www.nayuki.io/page/simple-deflate-decompressor</a><p>* <a href="https://github.com/nayuki/Simple-DEFLATE-decompressor" rel="nofollow">https://github.com/nayuki/Simple-DEFLATE-decompressor</a></p>
]]></description><pubDate>Fri, 27 Mar 2026 15:02:37 +0000</pubDate><link>https://news.ycombinator.com/item?id=47543480</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47543480</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47543480</guid></item><item><title><![CDATA[New comment by nayuki in "The miracle of PowerToys, Microsoft's last great Windows app"]]></title><description><![CDATA[
<p>> Microsoft PowerToys feels like something that shouldn’t exist in Windows today. What started in 2019 as a couple of utilities for things like window and shortcut management has gradually expanded to nearly 30 useful tools<p>Year 2019? Oh no, not by a longshot. I've been using Microsoft-branded PowerToys since Windows XP, around the year 2001. Wikipedia says:<p>> PowerToys are available for Windows 95, Windows XP, Windows 10, and Windows 11 (and explicitly not compatible with Windows Vista, 7, 8, or 8.1).<p><a href="https://en.wikipedia.org/wiki/Microsoft_PowerToys" rel="nofollow">https://en.wikipedia.org/wiki/Microsoft_PowerToys</a></p>
]]></description><pubDate>Fri, 20 Mar 2026 05:36:56 +0000</pubDate><link>https://news.ycombinator.com/item?id=47450883</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47450883</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47450883</guid></item><item><title><![CDATA[New comment by nayuki in "How to defer US taxes"]]></title><description><![CDATA[
<p>If I understand correctly, the "buy borrow die" strategy of tax avoidance hinges on these aspects of the tax code: Buying an asset is not a taxable event. Holding onto an asset and letting it appreciate is not a taxable event. Borrowing money is not a taxable event. Holding an appreciated asset until death will step up its cost basis to the current market value (thus erasing any capital gains taxes), and it can be passed on but large amounts will trigger inheritance taxes.</p>
]]></description><pubDate>Thu, 19 Mar 2026 20:12:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=47445223</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47445223</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47445223</guid></item><item><title><![CDATA[New comment by nayuki in "How to defer US taxes"]]></title><description><![CDATA[
<p>> Loaned money isn't taxable income, so you can save/spend it without affecting your tax rate.<p>> Death is a popular escape from deferred taxes. When you die, your obligations to the government vanish. Your heirs inherit assets/property at market value. Their assets depreciate from new cost bases.<p>The article talks about taxes in the USA, and I think the treatment of taxes at death is unfair by giving a significant tax advantage to people who hold assets till death, especially with the step-up basis. The way Canada handles it seems more reasonable to me:<p>> Capital property generally includes real estate, such as homes and cottages, investments like stocks, mutual funds or crypto-assets, and personal belongings like artwork, collections or jewelry. When a person dies, they are considered to have sold all their property just prior to death, even though there is no actual disposition or sale. This is called a deemed disposition and may result in a capital gain or capital loss<p>-- <a href="https://www.canada.ca/en/revenue-agency/services/tax/individuals/life-events/doing-taxes-someone-died/prepare-returns/report-income/capital-gains.html" rel="nofollow">https://www.canada.ca/en/revenue-agency/services/tax/individ...</a><p>In exchange, Canada does not have an inheritance tax. All taxation is resolved in the estate of the deceased person before the money or assets are passed on without further taxation.</p>
]]></description><pubDate>Thu, 19 Mar 2026 19:32:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=47444657</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47444657</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47444657</guid></item><item><title><![CDATA[New comment by nayuki in "John Carmack about open source and anti-AI activists"]]></title><description><![CDATA[
<p>Then by your definition, SQLite isn't open-source because it's a code dump with a license, but outsiders are not allowed to participate in shaping (the official copy of) the code.</p>
]]></description><pubDate>Fri, 13 Mar 2026 23:07:02 +0000</pubDate><link>https://news.ycombinator.com/item?id=47371216</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47371216</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47371216</guid></item><item><title><![CDATA[New comment by nayuki in "The Road Not Taken: A World Where IPv4 Evolved"]]></title><description><![CDATA[
<p>Their hypothetical approach of extending IPv4 reminds me of how TLS v1.3 masquerades as v1.2 in order to pass through meddling middleboxes safely.</p>
]]></description><pubDate>Fri, 13 Mar 2026 03:46:46 +0000</pubDate><link>https://news.ycombinator.com/item?id=47360462</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47360462</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47360462</guid></item><item><title><![CDATA[New comment by nayuki in "Why the global elite gave up on spelling and grammar"]]></title><description><![CDATA[
<p>There are a handful of neighborhood and street names used in Toronto (not necessarily <i>from</i> Toronto) that have unusual pronunciations. Here I'll give some triples of (English spelling, actual pronunciation (IPA), a naive pronunciation (IPA)):<p>(Yonge, [jʌŋ], [jɑndʒ]); (Strachan, [sdʒɹɑn], [ˈsdʒɹa.tʃæn]); (Tecumseth, [tə.ˈkʌm.zi], [ˈti.kəm.sɛθ]); (Markham, [ˈmɑr.kʌm], [ˈmɑrk.hæm]), (Etobicoke, [ɛ.ˈtoʊ.bɪ.koʊ], [ɛ.ˈtoʊ.bɪ.koʊk]).<p>See also: <a href="https://www.youtube.com/watch?v=i2cyg6bFeRc" rel="nofollow">https://www.youtube.com/watch?v=i2cyg6bFeRc</a> , <a href="https://www.youtube.com/watch?v=1PmeDWvwD8M" rel="nofollow">https://www.youtube.com/watch?v=1PmeDWvwD8M</a></p>
]]></description><pubDate>Wed, 11 Mar 2026 19:14:17 +0000</pubDate><link>https://news.ycombinator.com/item?id=47339898</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47339898</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47339898</guid></item><item><title><![CDATA[New comment by nayuki in "Lego's 0.002mm specification and its implications for manufacturing (2025)"]]></title><description><![CDATA[
<p>Upvoted, and the English prose is pretty good in spelling and grammar, but the metric units in the writing need improvement.<p>> 10 microns<p>"Micron(s)" is a deprecated word since 1967 and "micrometre(s)" must be used instead. The reason is that it is a non-standard word; if "micron" is accepted, then we should also accept the nonsensical words "millin", "nanon", "kilon", etc. The metric system is supposed to be easy to learn with consistent rules and as few special cases as possible.<p>> 4.8mm ... 0.01mm ... "0.002mm tolerance"<p>These numbers are correct, but it's harder to quickly skim the text and make comparisons because the number of decimal places vary. It would be better to write 4.800 mm, 0.010 mm, 0.002 mm to make the reader's job easier. Or convert everything to whole micrometres, like 4800 μm, 10 μm, 2 μm.<p>> withstand over 4,000 Newtons<p>Almost correct, but the unit must be decapitalized to "newtons". This is similar to how other name-based units are decapitalized - like "100-watt light bulb", "12 amps", "3 gigahertz".<p>> 2-3 Newton insertion force<p>It must be written as "2–3 newtons". When the unit name is written out in full, it follows normal English pluralization rules (e.g. metres, seconds, volts, pascals, kelvins, ohms, teslas). The only exceptions are hertz and siemens, because they already end with -s or -z.</p>
]]></description><pubDate>Wed, 11 Mar 2026 18:49:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=47339589</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47339589</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47339589</guid></item><item><title><![CDATA[New comment by nayuki in "A useless infinite scroll experiment"]]></title><description><![CDATA[
<p>Windows autoscroll makes this game too easy. This feature was introduced a very long time ago, possibly with the IntelliMouse in the year 1996. Press on the scroll wheel (considered to be middle-click) and release the button, which overlays a little scroll guide circle. Move the mouse down to begin scrolling, and don't touch anything else. Click any mouse button to stop scrolling. (Another variant is to click and hold the wheel button, move the mouse down to scroll, and release the button to stop.)</p>
]]></description><pubDate>Tue, 10 Mar 2026 08:11:42 +0000</pubDate><link>https://news.ycombinator.com/item?id=47320356</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47320356</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47320356</guid></item><item><title><![CDATA[New comment by nayuki in "All Look Same?"]]></title><description><![CDATA[
<p>2026 minus 2014 is 12 years</p>
]]></description><pubDate>Thu, 19 Feb 2026 02:41:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=47069233</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47069233</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47069233</guid></item><item><title><![CDATA[New comment by nayuki in "YouTube Is Down"]]></title><description><![CDATA[
<p>I mistakenly thought that YouTube hit a compatibility problem with my Firefox browser. The only breakage I could see was that the right sidebar of related/recommended videos disappeared. But I was watching several videos consecutively just fine. (I obtained video links from recent bookmarks, plus manually queued URLs of next videos to watch.)</p>
]]></description><pubDate>Wed, 18 Feb 2026 03:11:27 +0000</pubDate><link>https://news.ycombinator.com/item?id=47056671</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47056671</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47056671</guid></item><item><title><![CDATA[New comment by nayuki in "A review of M Disc archival capability with long term testing results (2016)"]]></title><description><![CDATA[
<p>> many are opting for digital only variants<p>DVDs and BDs <i>are</i> digital.</p>
]]></description><pubDate>Sun, 15 Feb 2026 07:51:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=47021847</link><dc:creator>nayuki</dc:creator><comments>https://news.ycombinator.com/item?id=47021847</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47021847</guid></item></channel></rss>