in reply to Extracting numbers from arrays
Abigail's solution is probably the best answer to your overall problem although it may not be the complete answer.
I think the main reason you were not finding the second number equal to the first even though it appeared to be there when you printed it out, is due to floating point round-off.
Basically, when you output floating point numbers using print, they may appear to have the same value, but this is due to them being rounded to a certain number of signifucant digits by default. The may look the same, but test them for equality using ==, and you will get false because they aren't actually identical at the binary level.
See the thread at Bug? 1+1 != 2 for some detailed explainations of the problem and how to work around it.
|
|---|