Skip to content

Numeric

Christoffer Fink edited this page Sep 1, 2014 · 3 revisions

Numeric parameters are defined in the XML configuration by using the NParam element, which must have its type attribute set to one of the supported types. Numeric parameters can optionally be defined with one or more ranges of legal values by specifying inclusive or exclusive min and max values.

Supported Numeric Types

  • boolean, true/false
  • short, 16 bit
  • integer, 32 bit
  • long, 64 bit
  • float, 32 bit
  • double, 64 bit
  • decimal, arbitrary precision

The boolean type is limited to true/false values. All numeric types (except boolean) are signed. The short, integer, and long types represent integer values. The float and double types represent floating point values. The decimal type is a floating point type with arbitrary precision. It is legal to specify limits for boolean parameters, but they are simply ignored.

Fixed Values

When a numeric parameter is fixed, that parameter will always be initialized to the specified value. In addition, setting the parameter to a different value in a design is illegal. Fixing a boolean numeric to an invalid boolean literal has no effect. That is, the parameter is not fixed.

As with limits, values are truncated when fixing integer parameters.

Expressions are not allowed when fixing a parameter.

Limits

Limits are complex enough to warrant a dedicated section.

Suggestions for Future Versions

It should be possible to fix a numeric parameter using an expression. Of course, the expression may not reference other parameters. Alternatively, referenced parameters could be allowed, provided that they are all fixed, but this would likely be complex and confusing.

Setting an invalid fixed value (such as an unrecognized boolean literal) should be illegal.

Relevant Tests

Clone this wiki locally