Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wonder if that negative int broke a bunch of code in software around the world


Interesting math question: When we now start at a negative price tomorrow, what does a percentage change mean? Today, we have got losses >100%, unusual but obviously possible. But if price changes tomorrow from say $-10 to $10, is that again -200%? Does a change from $-10 to -$20 mean +100%?

(I obviously know percentage changes are not made for this)


Follow up question: If it had ended at zero dollars, then the next day jumps to $5, what's the percentage change?


Follow up answer, it's never zero dollars.


Hum... We can know this today with the power of Math!

But seriously, changing to -$10 to -$20 is a +100% change. It's multiplication, this is how it works. From -$10 to $10 would be a -200% change.

Obviously, only the mainstream news reports finance numbers as a percentage of change. Anybody else is only concerned about ROI.


Well, NYSE stops at certain drop intervals, so percentage does also occur professionally:

https://en.wikipedia.org/wiki/Trading_curb


If I take 10$ to take some asset, and then later sell it for 20$ my return is 30$ and my investment was -10$, so my ROI comes out as -300% which betrays what's going on. So even with ROI, negative numbers throws a wrench in the machinerys typical assumptions.


I guess we'll find out tomorrow


Why is oil trading for $4 billi.. oh no


Son I sure hope thats not an Int. Its double, float or something else


To be doubly pedantic, it probably is an int in many places, to avoid rounding errors.


Correct. In finance it is the norm to store all currency amounts as int.


Let's hope it's a signed int, then.


I sure hope "something else". I'd really like to think it's fixed precision.


Often trading systems represent prices as integral values; using fixed point. It eliminates some problems with rounding.


Might be stored as an int in cents (or whatever the tick size is).


That's what I would do. Would never trust floating point numbers with something as important as currency.


Certainly broke the native stocks app on iOS. The graph only goes to zero, and the blue dot indicating the current price was rendered below the graph, in the news story section.


I work in finance. I literally ask this question of my boss today as I deal with market data. Didn't want a negative price to fuck with our systems (I've only been at the firm for 1 year, so not entirely comfortable with all our systems). Thankfully, we don't do much with futures, so we weren't too badly affected by this.

Also, we don't use int's. We use proper decimal types for currency values.


Arbitrary sized decimals? How do you deal with floating point math problems?


Certainly messed up the Yahoo finance graph:

https://finance.yahoo.com/quote/CL=F?p=CL=F

Look at the red block below the graph, where it should have gone negative.


CME website itself crashed for over an hour.


Do you have a source on this? I don't see anything in the news.


Anecdotally, CME wouldn't load quotes or charts for Oil Futures for me for a while around 1pm.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: