Produce an output token on each firing with a value that is
equal to the specified rounded value of the input.
The input type is DoubleToken. The output type is IntToken.
The functions are a subset of those in the java.lang.Math class.
They are:
<ul>
<li> <b>ceil</b>: Round towards positive infinity.
<li> <b>floor</b>: Round towards negative infinity.
<li> <b>round</b>: Round towards nearest integer. This is the
default behavior.
<li> <b>truncate</b>: Round towards zero.
</ul>
If the input is NaN, then an exception is thrown.
The reason for this is that there is no way to represent a NaN
as an integer. Thus, even though java.lang.Math.round(Double.NaN)
returns 0, ceil(Double.NaN), floor(Double.NaN) and truncate(DoubleNaN) all
return a Double.NaN. However, this actor has an integer output,
so there is no way to represent the Double.NaN as an integer, so
we throw an exception.
C. Fong, Contributor: Christopher Brooks
$Id: Round.java 70398 2014-10-22 23:44:32Z cxh $
Ptolemy II 1.0
Green (chf)
Green (janneck)
The rounding strategy to use. This is a string-valued parameter
that defaults to "round".