Math min interface¶
This page explains the Math
class’s min
class method interface.
What interface is this?¶
The min
class method interface returns a minimum number from a specified array of numbers.
Basic usage¶
The min
interface requires an Array
value argument (values
).
It returns a Number
value.
Notes: Regardless of the Array
values’ type, this interface returns a Number
type value.
import apysc as ap
ap.Stage()
arr: ap.Array = ap.Array([9, 10, ap.Int(8), ap.Number(9.5), 11])
min_value: ap.Number = ap.Math.min(values=arr)
assert min_value == 8
Math.min API¶
Note: the document build script generates and updates this API document section automatically. Maybe this section is duplicated compared with previous sections.
[Interface signature] min(values: apysc._type.array.Array) -> apysc._type.number.Number
[Interface summary]
Get a minimum number from a specified array’s values.
[Parameters]
values
: Array[Union[Int, Number, int, float]]An array of numbers.
[Returns]
min_value
: NumberMinimum number in an array.
[Examples]
>>> import apysc as ap
>>> _ = ap.Stage()
>>> arr: ap.Array = ap.Array([10, 9.5, ap.Int(8), ap.Number(8.5)])
>>> min_value: ap.Number = ap.Math.min(values=arr)
>>> min_value
Number(8.0)