Find a number out of a given Integer array. It can return the closest, smaller and larger number to the integer requested.

Files at this revision

API Documentation at this revision

Comitter:
O_Shovah
Date:
Thu Dec 21 13:01:31 2017 +0000
Parent:
7:2b1e34741392
Commit message:
Changed array cell designator.

Changed in this revision

find_number.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/find_number.cpp	Wed Dec 20 09:52:02 2017 +0000
+++ b/find_number.cpp	Thu Dec 21 13:01:31 2017 +0000
@@ -18,7 +18,7 @@
 
 int32_t find_number::find_closest(int32_t target_value)
 {
-    int32_t difference = abs( target_value - *selectable_values_array);
+    int32_t difference = abs( target_value - selectable_values_array[0]);
     int32_t closest_integer = selectable_values_array[0];
 
     for (int32_t cell = 0; cell < searched_array_size; cell++) {