#for FName, cmp in { { NearestIn,     < }
                     { FurthermostIn, > } } write

# // FName < PINT 'Index, T Array[], INT Length, ((T) T) Delta > : T
          -> T : INT, INT+-, INT64, INT64+-, CHAR, USHORT, ULONG, ULONG64, FIXED, FIXED64
+
  # // Run <>
  +
    Previous = Delta (Array[0]), *Index = 0 ..

    NumbersIn (Array, Length, (INT I, T Number) ->
      if Current cmp Previous / Current = Delta (Number) : Previous = Current, *Index = I
    )

    return 1
  ;

  return Run () [ Length > 0 ] | 0
;

# -> FName < PTR Index, Array, INT ., PTR Delta >
+
  return . [ Index, Array, Delta ] | ERR_PARAMETER
;

#end

