<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Suman Kumar</title>
    <description>The latest articles on DEV Community by Suman Kumar (@codewithkolin).</description>
    <link>https://dev.to/codewithkolin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4196057%2F2d5574a4-9ab3-426e-a244-603f46f59f69.png</url>
      <title>DEV Community: Suman Kumar</title>
      <link>https://dev.to/codewithkolin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codewithkolin"/>
    <language>en</language>
    <item>
      <title>What checking 244 calculators against their sources actually found</title>
      <dc:creator>Suman Kumar</dc:creator>
      <pubDate>Tue, 20 Oct 2026 11:34:15 +0000</pubDate>
      <link>https://dev.to/calculateeveryday/what-checking-244-calculators-against-their-sources-actually-found-h95</link>
      <guid>https://dev.to/calculateeveryday/what-checking-244-calculators-against-their-sources-actually-found-h95</guid>
      <description>&lt;p&gt;I run &lt;a href="https://calculateeveryday.com/" rel="noopener noreferrer"&gt;CalculateEveryday&lt;/a&gt;, a free site with 244 calculators: paycheck, mortgage, BMI, unit conversion, chemistry, statistics and so on. Each page shows the formula, a worked example, the source the formula was checked against, and a section called "Where this can give the wrong answer".&lt;/p&gt;

&lt;p&gt;Most of the first drafts were written with AI, and a second model reviewed them. That is exactly why the checks matter more than the drafting, so this post is about the checks: what the build refuses, what the tests pin, and the bugs that only appeared when each calculator was read against its published source.&lt;/p&gt;

&lt;h2&gt;
  
  
  A calculator can't get a page without a source
&lt;/h2&gt;

&lt;p&gt;Every calculator is an entry in one registry. An entry only builds a route if it carries a &lt;code&gt;verified&lt;/code&gt; record: how it was checked, against what, and when.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;verified&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;source-checked&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;source&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;OpenStax College Algebra 2e, §9.5 'Counting Principles' — P(n, r) = n! ÷ (n − r)! and C(n, r) = n! ÷ (r!(n − r)!)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2026-10-02&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That record prints on the page as "Formula last checked against … on …". A &lt;code&gt;noindex&lt;/code&gt; flag beats it. One India capital-gains calculator sat built but unpublished for seven weeks, because its debt-fund branch used rules from before 2023. It went live this week, for equity only, once the debt branch was gone.&lt;/p&gt;

&lt;h2&gt;
  
  
  One golden-value test file per calculator
&lt;/h2&gt;

&lt;p&gt;Each calculator has a test file of hand-worked values, preferably the source's own examples. There are 1,102 of them, and CI runs them before every deploy. A changed constant fails the build instead of shipping a wrong tax figure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 60C30 = 118,264,581,564,861,424 (OEIS A000984). Past 2^53 a&lt;/span&gt;
&lt;span class="c1"&gt;// floating-point count lost its last digits and showed …390.&lt;/span&gt;
&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;60C30 is exact: 118,264,581,564,861,424&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;60C30&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))?.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;118,264,581,564,861,424&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That test exists because the old version used floating-point numbers. The combinations calculator now uses &lt;code&gt;BigInt&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What reading each calculator against its source found
&lt;/h2&gt;

&lt;p&gt;Over two days in October, 237 of the then 243 pages were rewritten against a named source, and each calculator was checked against that source along the way. Forty faults turned up. A few of them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The baking-pan converter was inverted from launch.&lt;/strong&gt; Moving to a bigger pan gave a multiplier of 0.79, while the page's own text said 1.26.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Body fat fed centimetres into equations fitted in inches.&lt;/strong&gt; The US Navy formulas (Hodgdon and Beckett, 1984) expect inches. A 175 cm man with an 85 cm waist and 38 cm neck read 23.5% instead of 17.0%. Women were overstated by far more.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A unit-price comparison divided by the wrong base.&lt;/strong&gt; It called a jar "12.4% cheaper" when it was 11% cheaper, the same mistake the site's own discount page warns about.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Three states' paychecks ignored a deduction.&lt;/strong&gt; Alabama, Missouri and Oregon let federal income tax come off before state tax. The engine didn't, so it understated take-home pay. Utah's taxpayer credit phases out with income, and a flat $966 understated tax by about $540 at $60,000.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The lesson I keep coming back to: checking the calculator was worth more than writing the explanation around it. Fluent text is cheap now. Correct numbers still take a source and a test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Content rules that fail the build
&lt;/h2&gt;

&lt;p&gt;A site with hundreds of templated pages drifts toward the same sentences on every page, so the content rules are tests too:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;at least 700 words of real explanation per page (a few simple tools have a named lower floor), three or more FAQs, and a source that isn't just the formula restated;&lt;/li&gt;
&lt;li&gt;no sentence on more than 10 pages;&lt;/li&gt;
&lt;li&gt;a cap on the share of a page's sentences that also appear on another page. The 51 state paycheck pages started at 54–86% shared. The cap only ever moves down.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The 1.3 MB bug
&lt;/h2&gt;

&lt;p&gt;Last week I found that every page loaded a 1.3 MB script. One client component imported the registry, so every calculator's explanation and FAQs went to every visitor, on phones too. The browser now reads a small generated catalogue, about 17 KB gzipped. A test walks the imports of every &lt;code&gt;"use client"&lt;/code&gt; file and fails if any chain reaches the registry. The homepage went from 582 KB of gzipped JavaScript to 196 KB.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it still breaks
&lt;/h2&gt;

&lt;p&gt;Every page ends with the cases its formula doesn't cover: a 0% loan rate, a BMI for an athlete, a paycheck with tips. The method, including the parts done by AI, is written up at &lt;a href="https://calculateeveryday.com/how-we-check" rel="noopener noreferrer"&gt;How we check&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you know a calculator where the usual formula is quietly wrong, I'd like to hear about it. The &lt;a href="https://calculateeveryday.com/math/perm-combinations" rel="noopener noreferrer"&gt;combinations calculator&lt;/a&gt; is the one that taught me about 2^53.&lt;br&gt;
Copy&lt;br&gt;
Create your user account first, then Settings › Organization › create CalculateEveryday, with the logo from the kit as its image.&lt;br&gt;
In the editor choose to post under the CalculateEveryday organisation. Set the AI disclosure to "AI-assisted" (required since 26 Aug 2026).&lt;br&gt;
Change published: false to true when you're h&lt;/p&gt;

</description>
      <category>programming</category>
      <category>softwareengineering</category>
      <category>testing</category>
    </item>
  </channel>
</rss>
