• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/ucode/tests/custom/03_stdlib/46_min

  1 The `min()` function returns the minimum of all given arguments.
  2 
  3 If multiple equivalent minimum values are given (e.g. `null` and `false`
  4 both are treated as `0` when comparing numerically), the first minimal
  5 value is returned.
  6 
  7 Returns the minimum value among all given arguments or `null` if no
  8 arguments were passed.
  9 
 10 -- Testcase --
 11 {%
 12         printf("%.J\n", [
 13                 min(),
 14                 min(5, 1, 3, -10),
 15                 min("foo", "bar", "xxx", "abc"),
 16                 min(false, null, 0, NaN)
 17         ]);
 18 %}
 19 -- End --
 20 
 21 -- Expect stdout --
 22 [
 23         null,
 24         -10,
 25         "abc",
 26         false
 27 ]
 28 -- End --

This page was automatically generated by LXR 0.3.1.  •  OpenWrt