Skip to content

Modern Math MinOf

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Math Library › Math Library › MinOf

MinOf

Returns the smallest value in an array, or NaN if it is empty.

Syntax

MinOf( byref a as Array( of T ) ) as float64

Notes

  • Distinct from Min, which compares two values -- this reduces an array.
  • An empty array gives NaN.
  • Range is MaxOf minus this.

Examples

#import "std/numeric"
#import "std/containers"
using numeric
using containers

dim as Array( of float64 ) a = { 2.0, 4.0, 4.0, 4.0, 6.0 }

print MinOf( a )          '' 2
print MaxOf( a )          '' 6
print Range( a )          '' 4 -- the difference

Library: Math Library
Category: Math Library
Documented under: Members

Clone this wiki locally