Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
grezql
on April 20, 2020
|
parent
|
context
|
favorite
| on:
Oil plunges below zero for first time with May con...
Son I sure hope thats not an Int. Its double, float or something else
jetrink
on April 20, 2020
|
next
[–]
To be doubly pedantic, it probably is an int in many places, to avoid rounding errors.
koheripbal
on April 20, 2020
|
parent
|
next
[–]
Correct. In finance it is the norm to store all currency amounts as int.
mcv
on April 20, 2020
|
root
|
parent
|
next
[–]
Let's hope it's a signed int, then.
lotyrin
on April 20, 2020
|
prev
|
next
[–]
I sure hope "something else". I'd really like to think it's fixed precision.
cpwright
on April 20, 2020
|
prev
|
next
[–]
Often trading systems represent prices as integral values; using fixed point. It eliminates some problems with rounding.
rjtobin
on April 20, 2020
|
prev
[–]
Might be stored as an int in cents (or whatever the tick size is).
typon
on April 21, 2020
|
parent
[–]
That's what I would do. Would never trust floating point numbers with something as important as currency.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: