Find a number out of a given Integer array. It can return the closest, smaller and larger number to the integer requested.
Revision 6:4f4e609a6877, committed 2017-12-16
- Comitter:
- O_Shovah
- Date:
- Sat Dec 16 12:44:46 2017 +0000
- Parent:
- 5:196eba643b4c
- Child:
- 7:2b1e34741392
- Commit message:
- Fixed " find_larger" not finding the next larger number when given a target value smaller than the smallest number in the array.
Changed in this revision
find_number.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/find_number.cpp Sat Dec 16 12:39:00 2017 +0000 +++ b/find_number.cpp Sat Dec 16 12:44:46 2017 +0000 @@ -49,6 +49,8 @@ break; } + + if(selectable_values_array[0] > target_value) larger_integer = selectable_values_array[0]; } }