News for hackers. Stuff that matters.
Re:Oil plunges below zero for first time with May contract e... by typon on Monday April 20, 2020 @02:49PM (#22927007)
I wonder if that negative int broke a bunch of code in software around the world
Re:Oil plunges below zero for first time with May contract e... by patall on Monday April 20, 2020 @05:38PM (#22928895)
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)

Re:Oil plunges below zero for first time with May contract e... by symplee on Monday April 20, 2020 @07:26PM (#22930033)
Follow up question: If it had ended at zero dollars, then the next day jumps to $5, what's the percentage change?
Re:Oil plunges below zero for first time with May contract e... by marcosdumay on Monday April 20, 2020 @11:13PM (#22931469)
Follow up answer, it's never zero dollars.
Re:Oil plunges below zero for first time with May contract e... by marcosdumay on Monday April 20, 2020 @11:12PM (#22931465)
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.

Re:Oil plunges below zero for first time with May contract e... by patall on Tuesday April 21, 2020 @04:29AM (#22933090)
Well, NYSE stops at certain drop intervals, so percentage does also occur professionally:

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

Re:Oil plunges below zero for first time with May contract e... by jVinc on Tuesday April 21, 2020 @06:27PM (#22940011)
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.
Re:Oil plunges below zero for first time with May contract e... by gberger on Monday April 20, 2020 @07:24PM (#22930020)
I guess we'll find out tomorrow
Re:Oil plunges below zero for first time with May contract e... by keanebean86 on Monday April 20, 2020 @02:53PM (#22927059)
Why is oil trading for $4 billi.. oh no
Re:Oil plunges below zero for first time with May contract e... by grezql on Monday April 20, 2020 @02:58PM (#22927113)
Son I sure hope thats not an Int. Its double, float or something else
Re:Oil plunges below zero for first time with May contract e... by jetrink on Monday April 20, 2020 @03:08PM (#22927215)
To be doubly pedantic, it probably is an int in many places, to avoid rounding errors.
Re:Oil plunges below zero for first time with May contract e... by koheripbal on Monday April 20, 2020 @03:17PM (#22927315)
Correct. In finance it is the norm to store all currency amounts as int.
Re:Oil plunges below zero for first time with May contract e... by mcv on Monday April 20, 2020 @05:02PM (#22928512)
Let's hope it's a signed int, then.
Re:Oil plunges below zero for first time with May contract e... by lotyrin on Monday April 20, 2020 @03:08PM (#22927214)
I sure hope "something else". I'd really like to think it's fixed precision.
Re:Oil plunges below zero for first time with May contract e... by cpwright on Monday April 20, 2020 @03:18PM (#22927328)
Often trading systems represent prices as integral values; using fixed point. It eliminates some problems with rounding.
Re:Oil plunges below zero for first time with May contract e... by rjtobin on Monday April 20, 2020 @03:06PM (#22927191)
Might be stored as an int in cents (or whatever the tick size is).
Re:Oil plunges below zero for first time with May contract e... by typon on Monday April 20, 2020 @09:33PM (#22930949)
That's what I would do. Would never trust floating point numbers with something as important as currency.
Re:Oil plunges below zero for first time with May contract e... by kccqzy on Monday April 20, 2020 @09:15PM (#22930835)
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.
Re:Oil plunges below zero for first time with May contract e... by hermitdev on Monday April 20, 2020 @06:59PM (#22929783)
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.

Re:Oil plunges below zero for first time with May contract e... by typon on Monday April 20, 2020 @09:32PM (#22930946)
Arbitrary sized decimals? How do you deal with floating point math problems?
Re:Oil plunges below zero for first time with May contract e... by symplee on Monday April 20, 2020 @03:55PM (#22927793)
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.

Re:Oil plunges below zero for first time with May contract e... by koheripbal on Monday April 20, 2020 @03:16PM (#22927302)
CME website itself crashed for over an hour.
Re:Oil plunges below zero for first time with May contract e... by TwoFactor on Monday April 20, 2020 @03:31PM (#22927488)
Do you have a source on this? I don't see anything in the news.
Re:Oil plunges below zero for first time with May contract e... by greenshackle2 on Monday April 20, 2020 @04:13PM (#22927991)
Anecdotally, CME wouldn't load quotes or charts for Oil Futures for me for a while around 1pm.