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
Why don't you cast to the long? Although you can overflow it too, but it's a lot easier to overflow Int.
Of course, you can cast long if you need to.
x=3;
y=3; y=4;
Of course, you can go long if you need to.
So you're advertising a way, it'll be copied stupidly. Generally, you can't cast like this without any checks, it's UB:
So you're advertising a way, it'll be bluntly copied. You can't cast like that without checking, it's UB:
Maybe the deposit will sell out, and maybe do something else ))).I'm not advertising anything. I'm sharing an idea. That's what this forum and discussion is for.
x=3;
y=3; y=4;
Right! thanks. I'll have to see what I can do about the ceiling.
Dmitry Fedoseev:
x=3;
y=3; y=4;
as an option, although not very pretty, but the speed is the same:
as an option, although not very nice, but the speed is the same:
Then it would probably be better: x + 1 - DBL_MIN. Or x + 1 -DBL_EPSILON. I haven't checked it, try it.
Oh, and what about negative numbers? It should be different for ceil and floor
Then it would probably be better: x + 1 - DBL_MIN. Or x + 1 -DBL_EPSILON. I haven't checked it, try it.
Oh, and what about negative numbers? It must be different for ceil and floor
DBL_MIN andDBL_EPSILON don't work - they are too small. Perhaps it makes sense to leave it at 0.999999999999999999 (16 nines - the maximum number of decimal points in double)
Yes, you're right - there must be a different algorithm for negative numbers. Thank you! I will make an addition in the first post.
Who is interested - can think how to solve the problem with negative numbers. I personally am not interested, as all my problems are related to positive numbers.
It probably makes sense to leave 0.99999999999999999999 (16 nines - the maximum number of decimal places in double)
A100:
Yes, but if:
then it's fine. Miracles of the compiler. :))