Berkshire Hathaway’s Stock Price vs. 32-Bit Integers

Alexander Osipovich, reporting for The Wall Street Journal (News+ link):

Berkshire Hathaway Inc. is trading at more than $421,000 per Class A share, and the market is optimistic. That’s a problem. […] On Tuesday, Nasdaq Inc. temporarily suspended broadcasting prices for Class A shares of Berkshire over several popular data feeds. Such feeds provide real-time price updates for a number of online brokerages and finance websites.

Nasdaq’s computers can only count so high because of the compact digital format they use for communicating prices. The biggest number they can handle is $429,496.7295. Nasdaq is rushing to finish an upgrade later this month that would fix the problem.

That number will look familiar to the programmers among you: it’s the limit of an unsigned 32-bit integer. Using 32-bit integers for share prices, with four digits reserved for decimals, isn’t that crazy, though, given that no other stock in the U.S. has a share price that’s even close to the limit:

The U.S. stock with the second-highest share price, home builder NVR Inc., is trading just above $5,100 a share. Using compact formats that take up less memory can make software more efficient, a high priority in the world of electronic stock trading.

At the root of the problem is Mr. Buffett’s decadeslong refusal to execute a stock split of Berkshire’s Class A shares. The 90-year-old billionaire has signed birthday cards to friends with the message, “May you live until Berkshire splits,” according to Fortune magazine.

Update: Worth noting that they’re not using integers to store fractional values — what they’re doing is using 10,000ths of a dollar as their integral unit. The decimal gets shifted left by four digits simply to display prices as dollar values, but the math is all done in 10,000ths of a dollar units.

Not sure what their fix is going to be, but going to 64-bit integers would let them handle per-share prices up to $1,844,674,407,370,955.1615 — over $1.8 quadrillion — which should buy them some time, even if Berkshire continues to grow yet refuses to split.

Wednesday, 5 May 2021