MIN: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:_MIN}} The '''_MIN''' function returns the lesser of two given numeric values. {{PageSyntax}} : {{Parameter|minimum}} = _MIN({{Parameter|value1}}, {{Parameter|value2}}) {{PageParameters}} * {{Parameter|value1}} and {{Parameter|value2}} are the two numbers to compare, any integer or floating point type is supported. * {{Parameter|minimum}} is the lesser of both values returned as _FLOAT type. {{PageDescription}} * The function compares the giv...")
 
No edit summary
Line 4: Line 4:


{{PageSyntax}}
{{PageSyntax}}
: {{Parameter|minimum}} = [[_MIN]]({{Parameter|value1}}, {{Parameter|value2}})
: {{Parameter|minimum##}} = [[_MIN]]({{Parameter|value1}}, {{Parameter|value2}})




{{PageParameters}}
{{PageParameters}}
* {{Parameter|value1}} and {{Parameter|value2}} are the two numbers to compare, any integer or floating point type is supported.
* {{Parameter|value1}} and {{Parameter|value2}} are the two numbers to compare, any integer or floating point type is supported.
* {{Parameter|minimum}} is the lesser of both values returned as [[_FLOAT]] type.
* {{Parameter|minimum##}} is the lesser of both values returned as [[_FLOAT]] type.




Line 28: Line 28:
</gallery>
</gallery>
<!-- additional availability notes go below here -->
<!-- additional availability notes go below here -->
* The capability to load from ''memory'' was introduced in '''QB64-PE v3.5.0'''.





Revision as of 15:03, 3 November 2024

The _MIN function returns the lesser of two given numeric values.


Syntax

minimum## = _MIN(value1, value2)


Parameters

  • value1 and value2 are the two numbers to compare, any integer or floating point type is supported.
  • minimum## is the lesser of both values returned as _FLOAT type.


Description

  • The function compares the given numeric values and then returns the lesser of both numbers.
  • Will return value1 if the values are equivalent.


Availability


Examples

Example 1
Showcasing the _MIN and _MAX functions.
PRINT _MIN(345, 123)
PRINT _MIN(5.0001, 5.0)
PRINT _MIN(-34, -1.0E+1)
PRINT
PRINT _MAX(345, 123)
PRINT _MAX(5.0001, 5.0)
PRINT _MAX(-34, -1.0E+1)
 123
 5
-34

 345
 5.0001
-10


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link