I was trying to perform an order of magnitude calculation when I ran into the following issue:
double rawPrice = (Open[0] + High[0] + Low[0] + Close[0]) * 0.25;
int magnitude = Math.Floor(Math.Log10(Math.Abs(rawPrice)));
This will not compile even though it should.
I had to do an explicit cast to get this to compile; i.e.
double rawPrice = (Open[0] + High[0] + Low[0] + Close[0]) * 0.25;
int magnitude = (int)Math.Floor(Math.Log10(Math.Abs(rawPrice)));
Am I missing something here? Please advise. Thank you very much.
Comment