AuxRound



 
 

Color Convention
 Blue  Comments 
 Red  Generic Terms
 Yelow  Reserved  words and Commands 
 Brown  Defines
  Link  Link to other functions

 

/****************************************************************************
 *
 *  Auxiliary Function    : AuxRound
 *
 *  Description : Returns the rounded value
 *
 ****************************************************************************/
$generic
    $AuxRound = 'AuxRoundInt',   $InType = 'fix32.2', $OutType = 'int32';

$in

$OutType $AuxRound($InType val)
{
  $OutType newval =
       if (val == 0)
            return(0)
       elif (val > 0)
            return(val+0.5)
       else
            return(val-0.5);

} return(newval);

$end_generic