|
shrughes posted:Floating point for monetary values isn't necessarily a coding horror.
|
# ? Jun 30, 2012 23:54 |
|
|
# ? May 21, 2024 01:36 |
|
shrughes posted:Floating point for monetary values isn't necessarily a coding horror.
|
# ? Jul 1, 2012 00:52 |
|
shrughes posted:Floating point for monetary values isn't necessarily a coding horror. oh man here we go
|
# ? Jul 1, 2012 00:57 |
|
PrBacterio posted:Yes it is, what are you talking about? Even though in that case I hadn't even noticed it at first because of the bigger horrors that are present in that example Realtime trading systems, apparently. http://news.ycombinator.com/item?id=4161178
|
# ? Jul 1, 2012 00:57 |
|
shrughes posted:Realtime trading systems, apparently. But that's a drastically different context to what is suggested by "double salary = ...", if not something of an exceptional case. Are there any situations in which it would be sensible to represent somebody's salary or hourly wage with a floating-point number?
|
# ? Jul 1, 2012 01:09 |
|
I think his point is more that, like the use of goto, representing monetary values as floats isn't an automatic horror.
|
# ? Jul 1, 2012 01:30 |
|
shrughes posted:Realtime trading systems, apparently. That looks like a good way to be ruined in an audit. It may be at least not fundamentally a horrible idea if you're doing statistics or something and not accounting.
|
# ? Jul 1, 2012 01:35 |
|
hobbesmaster posted:That looks like a good way to be ruined in an audit. Not really? In terms of deciding which trades to perform you don't actually need the exact values. And no-one audits your HFT algorithms. Essentially, floating-point is fine if using an approximation of the actual amount is fine. In most cases where money is used (e.g. accounting) that's definitely not the case, but in some cases (such as the decision-making part of HFT), it is acceptable.
|
# ? Jul 1, 2012 01:39 |
|
Jabor posted:Not really? In terms of deciding which trades to perform you don't actually need the exact values. And no-one audits your HFT algorithms. I misread that, I thought thy were talking about executing trades using floating point for a moment there. That would be the not accounting statistics I said was an exception... Using doubles for a salary in an example is a horror though.
|
# ? Jul 1, 2012 01:42 |
|
shrughes posted:Realtime trading systems, apparently. That's not "real money" at that stage and I'll bet you the systems that reconcile the trades on the back end and hand out money are arbitrary precision.
|
# ? Jul 1, 2012 02:11 |
|
shrughes posted:Floating point for monetary values isn't necessarily a coding horror. e: trex eaterofcadrs posted:That's not "real money" Doc Hawkins fucked around with this message at 05:10 on Jul 1, 2012 |
# ? Jul 1, 2012 05:04 |
|
bitcoin is a horror but (mostly) not a coding one and it doesn't use FP to store values
|
# ? Jul 1, 2012 05:10 |
|
Aleksei Vasiliev posted:bitcoin is a horror but (mostly) not a coding one and it doesn't use FP to store values
|
# ? Jul 1, 2012 05:24 |
|
shrughes posted:Realtime trading systems, apparently. quote:For simple accounting, it wouldn't be slower. The issue is analytical code, e.g.: Do they not teach fixed point arithmetic in schools any more?* There's not even a mention of floats being useful for vectorising on modern CPUs, you know, modern like made in the last 10 years. Given the trillions of HFT transactions that go on every day (hour?), I wonder what the total dollar amount of rounding error is present in our financial system. * disclaimer: I was never taught fixed point arithmetic in school, but I'd at least heard of it.
|
# ? Jul 1, 2012 18:28 |
|
Zombywuf posted:Given the trillions of HFT transactions that go on every day (hour?), I wonder what the total dollar amount of rounding error is present in our financial system. Regardless of what is being used for HFT trading, the EOD accounting is still done with systems that track every last fraction of a cent actually made/lost so it won't really be that much.
|
# ? Jul 1, 2012 18:44 |
|
baquerd posted:Regardless of what is being used for HFT trading, the EOD accounting is still done with systems that track every last fraction of a cent actually made/lost so it won't really be that much.
|
# ? Jul 1, 2012 19:10 |
|
baquerd posted:Regardless of what is being used for HFT trading, the EOD accounting is still done with systems that track every last fraction of a cent actually made/lost so it won't really be that much. It's more a critique of the efficient market hypothesis.
|
# ? Jul 1, 2012 19:21 |
|
Tangential: Doesn't at least one HFT group use OCaml, the language where you can't bat an eye at a float without boxing it?
|
# ? Jul 1, 2012 23:37 |
|
Mustach posted:Tangential: Doesn't at least one HFT group use OCaml, the language where you can't bat an eye at a float without boxing it? Jane St Capital IIRC
|
# ? Jul 2, 2012 00:12 |
|
My general notion has been, for my web app, I'm fine with displaying currency as a float (since that's what PHP's money_format() does, which might be a horror in itself, and the precision is more than sufficient for the currency values I'm dealing with), but never do math on it as a float. There's a reason PHP has the bcmath extension. Even better would be if PHP gave us a currency datatype, but we have what we have.
|
# ? Jul 2, 2012 02:34 |
|
Mustach posted:Tangential: Doesn't at least one HFT group use OCaml, the language where you can't bat an eye at a float without boxing it? Wow, I wouldn't believe it if I hadn't seen their blog where they're still bragging about it. I mean granted it's probably a typical finance office where their HFT guy is literally just that one guy feeding numbers into a black box. If you're going to build a high-performance system on something that likes to box and generally isn't C, you at least have to pick something on the JVM. There's no way the
|
# ? Jul 2, 2012 05:03 |
|
ultramiraculous posted:Wow, I wouldn't believe it if I hadn't seen their blog where they're still bragging about it. I mean granted it's probably a typical finance office where their HFT guy is literally just that one guy feeding numbers into a black box. lol
|
# ? Jul 2, 2012 05:51 |
|
ultramiraculous posted:Wow, I wouldn't believe it if I hadn't seen their blog where they're still bragging about it. I mean granted it's probably a typical finance office where their HFT guy is literally just that one guy feeding numbers into a black box. Isn't the idea in using OCaml or Haskell that they allow for better/ easier parallelization, and that is something that HFT relies on for speed?
|
# ? Jul 2, 2012 05:55 |
|
takamoron posted:Isn't the idea in using OCaml or Haskell that they allow for better/ easier parallelization, and that is something that HFT relies on for speed? Yes. Haskell beats OCaml hands down though...
|
# ? Jul 2, 2012 06:10 |
|
OCaml is usually pretty bad for parallel computing due to having a GIL that shits a lot of stuff up. As far as I know, OCaml is fast due to its apparently good compiler that can optimizes lots of stuff due to its type system. MLs and their derivatives have had some pretty interesting compiler research through the years. I figure (pure speculation) that this helped OCaml's compiler indirectly.
|
# ? Jul 2, 2012 06:32 |
|
Isn't HFT the guys that send half a network packet out on the wire before they even know what's going in it? I'm surprised they use something other than pure assembly.
|
# ? Jul 2, 2012 06:37 |
|
ymgve posted:Isn't HFT the guys that send half a network packet out on the wire before they even know what's going in it? I'm surprised they use something other than pure assembly. Well, you also want to have as few errors as possible when handling money like that. I figure a high level language is more useful in that perspective. E: OCaml works well with Coq, a tool for formal proofs. MononcQc fucked around with this message at 06:50 on Jul 2, 2012 |
# ? Jul 2, 2012 06:43 |
|
ymgve posted:Isn't HFT the guys that send half a network packet out on the wire before they even know what's going in it? I'm surprised they use something other than pure assembly. I imagine there are different levels of hft, not all types of hft can rely on that kind of stuff.
|
# ? Jul 2, 2012 08:18 |
|
https://bugs.php.net/bug.php?id=18556 Ten years later...
|
# ? Jul 2, 2012 09:53 |
|
etcetera08 posted:https://bugs.php.net/bug.php?id=18556 quote:Why is this bug still not fixed? Not only class names are affected but function names aswell: PHP: Intresting, is it not?
|
# ? Jul 2, 2012 10:51 |
|
ymgve posted:Isn't HFT the guys that send half a network packet out on the wire before they even know what's going in it? I'm surprised they use something other than pure assembly. Well, you have to wonder if they really are the atomic superman coders they claim to be. Most high finance types think of themselves as gods amongst men, I suspect that the HFT guys have no more idea what they're doing that the rest of the tech industry.
|
# ? Jul 2, 2012 11:58 |
|
Hammerite posted:PHP: Intresting, is it not? E: \/\/\/ SirViver fucked around with this message at 12:15 on Jul 2, 2012 |
# ? Jul 2, 2012 12:00 |
|
SirViver posted:Well, to be fair, Turkish upper/lowercase behavior is a common trap. Of course this doesn't excuse it still not being fixed. They misspelled "interesting".
|
# ? Jul 2, 2012 12:09 |
|
etcetera08 posted:https://bugs.php.net/bug.php?id=18556 The real horror is that function calls are case-insensitive
|
# ? Jul 2, 2012 12:24 |
|
qntm posted:The real horror is that function calls are case-insensitive FORTRAN would like a word.
|
# ? Jul 2, 2012 12:26 |
|
qntm posted:The real horror is that function calls are case-insensitive There's nothing wrong with case-insensitive identifiers. The real horror is that function names are case-insensitive, but variable names aren't.
|
# ? Jul 2, 2012 12:30 |
|
that awful man posted:There's nothing wrong with case-insensitive identifiers. Variable names aren't, but array keys are.
|
# ? Jul 2, 2012 13:39 |
|
Golbez posted:Variable names aren't, but array keys are. ? code:
code:
|
# ? Jul 2, 2012 13:48 |
|
Hammerite posted:?
|
# ? Jul 2, 2012 14:39 |
|
|
# ? May 21, 2024 01:36 |
|
Zombywuf posted:Well, you have to wonder if they really are the atomic superman coders they claim to be. Most high finance types think of themselves as gods amongst men, I suspect that the HFT guys have no more idea what they're doing that the rest of the tech industry. I wonder if they're like a lot of really smart guys in professions that use programming rather than being in a profession about programming. Take the typical1 code written by a scientist...yuck. 1 Not that I have a lot of experience looking at scientific code, but the little bit that I have is not pretty.
|
# ? Jul 2, 2012 14:50 |