You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Because converting double to integer (this way) is shitty code. Round with friends is not designed to get integer type from floating type.
Well, who's stopping you from changing the function type to double.
No offence meant. There are all sorts of rint, lrint, llrint for conversion to integer. They did not just appear for a reason when it is much easier to do long(double). Converting floating to integer is a conceptual error.
No offence meant. There are all sorts of rint, lrint, llrint to convert to integer. They were invented for a reason, when you can do a lot easier than long(double). Converting floating to integer is a conceptual error.
Oh, you're just out of touch...
OK, the UB is in your hands.
Ambiguous interpretation then. Decided to output the cycle time, not the average time of one function call.
The gain is between 3 and 8 times.
Perhaps the method of calculating the time-to-function is not flawless, but it is quite objective. But if someone suggests a better, more unbiased method, that would be nice.
I changed it to type double for full analogy.
I suggest that the developers use this algorithm in regular functions.
I don't understand why rounding functions should return double either. In my opinion, that's the point of rounding - you need to define how to get an integer from a floating value.
What "conceptual error" of conversion is not quite clear to me either.
I don't understand why rounding functions should return double either. In my opinion, that's the point of rounding - you need to define how to get an integer from a floating value.
What "conceptual error" of conversion is not quite clear to me either.
NormalizeDouble
The result is 1123275 and 1666643 in favour of MyNormalizeDouble (Optimize=1). Without optimization it is four times faster (in memory).
I always wanted to ask you if there is much you can program in your code style.
If you have a task to design and create a very complex mechanism by yourself, is it worth using your way of writing code? And you must check the performance of each record at every step.
How much time will it take a developer to read/write/verify the code, if you approach this process in your style and at your level?
I bet I'd grow old without writing even half of what I had in mind.
zy. Sorry about the offtops. Programming style is a personal matter. But at a certain point, you start to realize that code should be as readable as possible, precisely for productivity purposes.
I've always wanted to ask you - how much can you program in your style of code?
An example of my style?