Why is this if statement does not work?
7 visualizzazioni (ultimi 30 giorni)
if (oval1x ~= sObjVal1(1) || oval1x ~= sObjVal1(end))
it happened that oval1x=4.2139; and sObjVal1(1)=4.2139; but the loop did not work correctly
Edit: is there a way to correct this issue?
madhan ravi il 20 Feb 2020
Modificato: madhan ravi il 20 Feb 2020
Because they are float numbers, reading the below links might help you better about floating numbers:
You could add tolerance to satisfy the conditions , search inside the forum with the tag "floating point" you would find lots of explanations about it.