Nasdaq had to adjust core code after Berkshire Hathaway share price high
Stock price exceeded the maximum value for storing 32-bit unsigned integers
The share price of investment group Berkshire Hathaway rose so high recently that it briefly broke the code of the Nasdaq stock exchange.
As reported by The Register, Nasdaq uses 32-bit unsigned integers as opposed to 64-bit unsigned integers for stocks listed on its exchange.
Normally this wouldn't be a problem but because the investment group, run by legendary investor Warren Buffett, is so highly valued, its BRK.A stock exceeded the maximum value of a 32-bit variable.
- We've assembled a list of the best stock trading apps available
- These are the best personal finance software solutions around
- Also check out our roundup of the best accounting software
This is 4,294,967,295 in decimal - and at the time of writing, one share of BRK.A stock is currently valued at over $437k per share. The stock is also listed on the New York Stock Exchange but unlike Nasdaq, it was unaffected by the bug.
Breaking Nasdaq's code
Following BRK.A's recent increase in price, the Nasdaq exchange stopped transmitting information about the stock on both its website and in the feeds of brokers and other financial organizations. Instead, the website for the stock displayed a message which read “Data is currently not available”.
As Nasdaq doesn't store stock prices using a floating-point number format likely due to the fact that they can be approximate, the exchange multiply quotes by 10,000 and stores them as 32-bit unsigned integers. In this case the value 123,456 represents a stock price of $12.3456.
BRK.A's current price of $437,131.0000 would be stored as 4,371,310,000 and this exceeds the maximum of 4,294,967,295 and for this reason, it would overflow to a value far lower than the actual stock price as it would wrap around from the maximum to zero and then go past zero to 43,713,100 or $4,713.100.
Are you a pro? Subscribe to our newsletter
Sign up to the TechRadar Pro newsletter to get all the top news, opinion, features and guidance your business needs to succeed!
If Nasdaq had broadcast this price online, there would be utter pandemonium as investors would think the stock lost over $400k in value while consumers would believe that they could pick up shares of one of the world's highest valued stocks at a bargain price.
According to Nasdaq, the exchange has said that the issue will be fixed by May 17.
“Data integrity is of utmost importance at Nasdaq, we therefore instituted a temporary measure starting May 4, 2021 to ensure that no incorrect data is disseminated prior to the completion of a technical upgrade," Nasdaq said in a statement to TechRadar Pro.
"As a result, the real-time price information of the sole affected security (BRK.A) will not be available on Nasdaq proprietary data feeds until May 17, 2021.”
- We've also featured the best cryptocurrency exchanges
After working with the TechRadar Pro team for the last several years, Anthony is now the security and networking editor at Tom’s Guide where he covers everything from data breaches and ransomware gangs to the best way to cover your whole home or business with Wi-Fi. When not writing, you can find him tinkering with PCs and game consoles, managing cables and upgrading his smart home.