News for hackers. Stuff that matters.
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.