Package ptolemy.math

Examples of ptolemy.math.FixPoint.doubleValue()


            FixToken fixToken = (FixToken) token;
            FixPoint fixValue = fixToken.fixValue();
            List args = new ArrayList(3);

            // Some possible loss of precision?
            args.add(DoubleConstant.v(fixValue.doubleValue()));
            args.add(IntConstant.v(fixValue.getPrecision().getNumberOfBits()));
            args.add(IntConstant.v(fixValue.getPrecision()
                    .getIntegerBitLength()));

            Local tokenLocal = _buildConstantTokenLocal(body, insertPoint,
View Full Code Here


     */
    public static double quantize(double value, int numberOfBits,
            int integerBits) {
        FixPoint fixValue = Quantizer.round(value, new Precision(numberOfBits,
                integerBits));
        return fixValue.doubleValue();
    }
}
View Full Code Here

     */
    public void fire() throws IllegalActionException {
        super.fire();
        FixToken in = (FixToken) input.get(0);
        FixPoint value = in.fixValue();
        output.send(0, new DoubleToken(value.doubleValue()));
    }

    /** Return false if the input port has no token, otherwise return
     *  what the superclass returns (presumably true).
     *  @exception IllegalActionException If there is no director.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.