:maxIntegerValues
{
 Description: 
    Returns the greatest value from passed integer values.
  
 Parameters:
   Passed:
     0@ - number of passed integer values 
     1@, 2@, 3@... - integer values 
     
   Result:
     31@ - the greatest value
 
 Example:
  0AB1: call_scm_func @maxIntegerValues 4 number_of_values 3 value1 43 value2 21 value3 90 store_result 0@ 
}
31@ = 0x80000000        // result = 0x80000000  ; lowest 32-bit integer value
    for 30@ = 1 to 0@
        if
        001D:   0@(30@,1i) > 31@  // (int)
        else_jump continue        
        0085: 31@ = 0@(30@,1i) // (int)
    end
0AB2: ret 1 31@

:minIntegerValues
{
 Description: 
    Returns the greatest value from passed integer values.

 Parameters:
   Passed:
     0@ - number of passed integer values 
     1@, 2@, 3@... - integer values 
     
   Result:
     31@ - the smallest value
 
 Example:
  0AB1: call_scm_func @minIntegerValues 4 number_of_values 3 value1 43 value2 21 value3 90 store_result 0@ 
}
31@ = 0x7FFFFFFF       // result = 7FFFFFFF    ; highest 32-bit integer value

    for 30@ = 1 to 0@
        if
        001D:   31@ > 0@(30@,1i)  // (int)
        else_jump continue        
        0085: 31@ = 0@(30@,1i) // (int)
    end
    
0AB2: ret 1 31@

:maxFloatValues
{
 Description: 
    Returns the greatest value from passed float values.
  
 Parameters:
   Passed:
     0@ - number of passed integer values 
     1@, 2@, 3@... - integer values 
     
   Result:
     31@ - the greatest value
 
 Example:
  0AB1: call_scm_func @maxFloatValues 4 number_of_values 3 value1 43 value2 21 value3 90 store_result 0@ 
}
31@ = -3.4E+38        // lowest 32-bit float value
    for 30@ = 1 to 0@
        if
        0025:   0@(30@,1i) > 31@  // (float)
        else_jump continue        
        0087: 31@ = 0@(30@,1i) // (float)
    end
0AB2: ret 1 31@

:minFloatValues
{
 Description: 
    Returns the greatest value from passed integer values.

 Parameters:
   Passed:
     0@ - number of passed integer values 
     1@, 2@, 3@... - integer values 
     
   Result:
     31@ - the smallest value
 
 Example:
  0AB1: call_scm_func @maxFloatValues 4 number_of_values 3 value1 43 value2 21 value3 90 store_result 0@ 
}
31@ = 3.4E+38       // highest 32-bit float value

    for 30@ = 1 to 0@
        if
        0025:   31@ > 0@(30@,1i)  // (float)
        else_jump continue        
        0087: 31@ = 0@(30@,1i) // (float)
    end
    
0AB2: ret 1 31@

:getYAngleBetweenPoints
{
  Parameters:
    Passed:
      0@ - origin X
      1@ - origin Y
      2@ - origin Z
      3@ - destination X
      4@ - destination Y
      5@ - destination Z
    Result:
      7@ - absolute Y angle

  Example:
    0AB1: call_scm_func @getYAngleBetweenPoints 6 from_XYZ 0.0 0.0 0.0 and_XYZ 1.0 0.0 0.0 store_to 1@ 
}
0509: 6@ = distance_between_XY 0@ 1@ and_XY 3@ 4@ 
0063: 2@ -= 5@ 
0604: get_Z_angle_for_point 6@ 2@ store_to 7@ 
0AB2: ret 1 7@ 

:getZAngleBetweenPoints
{
  Parameters:
    Passed:
      0@ - origin X
      1@ - origin Y
      2@ - destination X
      3@ - destination Y
    Result:
      4@ - absolute Z angle

  Example:
    0AB1: call_scm_func @getZAngleBetweenPoints 4 from_XY 0.0 0.0 and_XY 1.0 0.0 store_to 1@ 
}
0063: 0@ -= 2@ 
0063: 1@ -= 3@ 
0604: get_Z_angle_for_point 0@ 1@ store_to 4@ 
0AB2: ret 1 4@

:GetIntRemainder
{
 Description: 
    Finds a remainder of INT division. For example 5 % 2 = 1   
 Type: PROC
 
 Parameters:
   Passed:
     0@ - dividend
     1@ - divisor
     
   Result:
     0@ - remainder 
 
 Example:
 0AB1: call_scm_func @GetIntRemainder 2 divisor 5 % divisor 2 store_remainder_to 0@     
}
0A91: 2@ = 0@ / 1@ // int
006A: 2@ *= 1@  // (int)
0062: 0@ -= 2@  // (int)
005A: 0@ += 1@  // (int)

0A91: 2@ = 0@ / 1@ // int
006A: 2@ *= 1@  // (int)
0062: 0@ -= 2@  // (int)
0AB2: ret 1 0@

:FloatPartsToIntegerValuesLengthUnspecified
{
 Description: 
    Converts a float part before and after point to integer values 

 Parameters:
   Passed:
     0@ - number (float) 
     
   Result:
     0@ - before point
     1@ - after point 
 
 Example:
  0AB1: call_scm_func @FloatPartsToIntegerValuesLengthUnspecified 1 num 1.0 before_point_to 1@ after_point 2@
}
0092: 1@ = float 0@ to_integer 

0093: 2@ = integer 1@ to_float   
0063: 0@ -= 2@  // (float)

    while true
    0092: 2@ = float 0@ to_integer
    0093: 2@ = integer 2@ to_float
    0087: 3@ = 0@ // (float)
    0063: 3@ -= 2@  // (float)

        if and
        3@ > 0.0
        3@ < 1.0
        jf break
    0@ *= 10.0    
    end
0092: 0@ = float 0@ to_integer        
0AB2: ret 2 1@ 0@

:FloatPartsToIntegerValuesLengthSpecified
{
 Description: 
    Converts a float part before and after point to integer values 

 Parameters:
   Passed:
     0@ - number (float) 
     1@ - precision
     
   Result:
     0@ - before point
     1@ - after point 
 
 Example:
  0AB1: call_scm_func @FloatPartsToIntegerValuesLengthSpecified 2 num 1.0 after_comma_accuraccy 4 before_point_to 1@ after_point 2@
}
0097: make 0@ absolute_float
0092: 2@ = float 0@ to_integer

0093: 3@ = integer 2@ to_float
0063: 0@ -= 3@  // (float)

    if
    1@ > 0
    then
    4@ = 10.0
        while 1@ > 1
        4@ *= 10.0    
        1@ -= 1
        end
    006B: 0@ *= 4@  // (float)    
    end 

0092: 3@ = float 0@ to_integer 
0093: 3@ = integer 3@ to_float 
0087: 4@ = 0@ // (float)
0063: 4@ -= 3@  // (float)  

0092: 0@ = float 0@ to_integer
    if
    4@ > 0.0
    then
    0@ += 1
    end

0AB2: ret 2 2@ 0@