It's your calculations, isn't better to check for valid conditions beforehand ?
Seems to me checking the result is only needed when you have to deal with "foreign" values.
If i establish the limits (the "logical" ones) of each measurement then i can decide if its a small positive , small negative , big positive , big negative to carry the calculation forward
Although the issue is coming from multiplying very tiny numbers i suspect
To explain it a bit further , let's say i have identified 2 properties and i want to see how the price reacts per property a per property b . That is 2 divisions.
Then to create a "forecast" i multiply current property a with current property b by the number above .
Lorentzos Roussos #: If i establish the limits (the "logical" ones) of each measurement then i can decide if its a small positive , small negative , big positive , big negative to carry the calculation forward
Although the issue is coming from multiplying very tiny numbers i suspect
I agree with Alain. You should be finding and fixing the "cause" and not trying to resolve the "result".
Even if the product of multiple tiny numbers results in a zero, you can still test that condition before using it in a division.
However, a "-nan" is not caused by division, so you should be searching for a negative number in a square root or log operation.
If i establish the limits (the "logical" ones) of each measurement then i can decide if its a small positive , small negative , big positive , big negative to carry the calculation forward
Although the issue is coming from multiplying very tiny numbers i suspect
No it's not ! At least it should not according to the standard (you should read the link I provided ;-) ).
I agree with Alain. You should be finding and fixing the "cause" and not trying to resolve the "result".
Even if the product of multiple tiny numbers results in a zero, you can still test that condition before using it in a division.
However, a "-nan" is not caused by division, so you should be searching for a negative number in a square root or log operation.
Actually I am thinking, maybe, for performance reason, there could be cases where it's better to check the result. But it depends of the specific logic.
As a general rule though I would check for the "cause".
Actually I am thinking, maybe, for performance reason, there could be cases where it's better to check the result. But it depends of the specific logic.
As a general rule though I would check for the "cause".
yeah , the question then is do i trust the forecast if i have been containing the values
There is also the choice of "Irregular Forecast" and passing that to the user
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I suppose there is no way to "catch" the negative nan or nan without converting to string
Why do you need that ?
It's your calculations, isn't better to check for valid conditions beforehand ?
Seems to me checking the result is only needed when you have to deal with "foreign" values.
You can also use a union between a double and a long and compare the long value of a nan, -nan, inf and -inf for testing equality.
i forgot -inf ... thanks . is that possible ? i were dividing by the mathAbs and checking for the sign but it always were false
Why do you need that ?
It's your calculations, isn't better to check for valid conditions beforehand ?
Seems to me checking the result is only needed when you have to deal with "foreign" values.
If i establish the limits (the "logical" ones) of each measurement then i can decide if its a small positive , small negative , big positive , big negative to carry the calculation forward
Although the issue is coming from multiplying very tiny numbers i suspect
To explain it a bit further , let's say i have identified 2 properties and i want to see how the price reacts per property a per property b . That is 2 divisions.
Then to create a "forecast" i multiply current property a with current property b by the number above .
Although the issue is coming from multiplying very tiny numbers i suspect
I agree with Alain. You should be finding and fixing the "cause" and not trying to resolve the "result".
Even if the product of multiple tiny numbers results in a zero, you can still test that condition before using it in a division.
However, a "-nan" is not caused by division, so you should be searching for a negative number in a square root or log operation.
If i establish the limits (the "logical" ones) of each measurement then i can decide if its a small positive , small negative , big positive , big negative to carry the calculation forward
Although the issue is coming from multiplying very tiny numbers i suspect
No it's not ! At least it should not according to the standard (you should read the link I provided ;-) ).
No it's not ! At least it should not according to the standard (you should read the link I provided ;-) ).
That would narrow it down to the standard deviations and correlation . I'll check again .
I agree with Alain. You should be finding and fixing the "cause" and not trying to resolve the "result".
Even if the product of multiple tiny numbers results in a zero, you can still test that condition before using it in a division.
However, a "-nan" is not caused by division, so you should be searching for a negative number in a square root or log operation.
Yeah
I agree with Alain. You should be finding and fixing the "cause" and not trying to resolve the "result".
Even if the product of multiple tiny numbers results in a zero, you can still test that condition before using it in a division.
However, a "-nan" is not caused by division, so you should be searching for a negative number in a square root or log operation.
Actually I am thinking, maybe, for performance reason, there could be cases where it's better to check the result. But it depends of the specific logic.
As a general rule though I would check for the "cause".
You can also use a union between a double and a long and compare the long value of a nan, -nan, inf and -inf for testing equality.
This catches them , faster than strings i assume . thanks the replacement #'s were for show
Actually I am thinking, maybe, for performance reason, there could be cases where it's better to check the result. But it depends of the specific logic.
As a general rule though I would check for the "cause".
yeah , the question then is do i trust the forecast if i have been containing the values
There is also the choice of "Irregular Forecast" and passing that to the user