So i need to find out which float value in an array holding 16 numbers is closest to another float value (all values are constantly changing). The range for all values is -180 to positive 180 (So a circle). I need to make this into a function so i can call it multiple times. Can anyone give me a hand? Ty very much in advance.
hrmm that sounds like a goo beginner challenge, i cant think of anything now i will get back to you and start working on it myself straight away im thinking of adding o.o1 to see if my chosen number is within <or> bounds and then trying o.oo1 then checking if it is in bounds, or the other way, subtracting 0.001 untill only one == comes up.
EDIT: so if there are 16 numbers i have to find the closest 2?