# fimath Properties

Properties of the `fimath`

object

`fimath`

properties determine the rules for performing fixed-point
arithmetic operations on `fi`

objects. `fimath`

properties are,
by transitivity, also properties of the `fi`

object. You can set these
properties for individual `fi`

objects. `fimath`

object
properties are always writable.

## Sum Data Type Properties

`CastBeforeSum`

— Whether both operands are cast to the sum data type before addition

`0`

(`false`

) (default) | `1`

(`true`

)

Whether both operands are cast to the sum data type before addition, specified as one of these values:

`0`

(`false`

) — Do not cast before sum`1`

(`true`

) — Cast before sum

**Note**

This property is hidden when the `SumMode`

is set to
`FullPrecision`

.

`MaxSumWordLength`

— Maximum allowable word length for the sum data type

`65535`

(default) | positive integer

Maximum allowable word length for the sum data type, specified as a positive integer.

`SumBias`

— Bias of the sum data type

`0`

(default) | floating-point number

Bias of the sum data type, specified as a floating-point number.

`SumFixedExponent`

— Fixed exponent of the sum data type

`-30`

(default) | positive or negative integer

Fixed exponent of the sum data type, specified as a positive or negative integer.

**Note**

The `SumFractionLength`

is the negative of the
`SumFixedExponent`

. Changing one property changes the
other.

`SumFractionLength`

— Fraction length of the sum data type in bits

`30`

(default) | positive or negative integer

Fraction length of the sum data type in bits, specified as a positive or negative integer.

**Note**

The `SumFractionLength`

is the negative of the
`SumFixedExponent`

. Changing one property changes the
other.

`SumMode`

— How the sum data type is determined

`FullPrecision`

(default) | `KeepLSB`

| `KeepMSB`

| `SpecifyPrecision`

How the sum data type is determined, specified as one of the following:

`FullPrecision`

— Keep the full precision of the result.`KeepLSB`

— Keep least significant bits. Specify the sum data type word length, while the fraction length is set to maintain the least significant bits of the sum.`KeepMSB`

— Keep most significant bits. Specify the sum data type word length, while the fraction length is set to maintain the most significant bits of the sum and no more fractional bits than necessary.`SpecifyPrecision`

— Specify the word and fraction lengths or the slope and bias of the sum data type.

`SumSlope`

— Slope of the sum data type

`9.3132e-010`

(default) | floating-point number

Slope of the sum data type, specified as a floating-point number.

**Note**

$$SumSlope\text{=}SumSlopeAdjustmentFactor\times {2}^{SumFixedExponent}$$

Changing one of these properties affects the others.

`SumSlopeAdjustmentFactor`

— Slope adjustment factor of the sum data type

`1`

(default) | floating-point number greater than or equal to 1 and less than 2

Slope adjustment factor of the sum data type, specified as a floating-point number greater than or equal to 1 and less than 2.

**Note**

$$SumSlope\text{=}SumSlopeAdjustmentFactor\times {2}^{SumFixedExponent}$$

Changing one of these properties affects the others.

`SumWordLength`

— Word length of the sum data type in bits

`32`

(default) | positive integer

Word length of the sum data type in bits, specified as a positive integer.

## Product Data Type Properties

`MaxProductWordLength`

— Maximum allowable word length for the product data type

`65535`

(default) | positive integer

Maximum allowable word length for the product data type, specified as a positive integer.

`ProductBias`

— Bias of the product data type

`0`

(default) | floating-point number

Bias of the product data type, specified as a floating-point number.

`ProductFixedExponent`

— Fixed exponent of the product data type

`-30`

(default) | positive or negative integer

Fixed exponent of the product data type, specified as a positive or negative integer.

**Note**

The `ProductFractionLength`

is the negative of the
`ProductFixedExponent`

. Change one property changes the
other.

`ProductFractionLength`

— Fraction length of the product data type in bits

`30`

(default) | positive or negative integer

Fraction length of the product data type in bits, specified as a positive or negative integer.

**Note**

The `ProductFractionLength`

is the negative of the
`ProductFixedExponent`

. Changing one property changes the
other.

`ProductMode`

— How the product data type is determined

`FullPrecision`

(default) | `KeepLSB`

| `KeepMSB`

| `SpecifyPrecision`

How the product data type is determined, specified as one of these values:

`FullPrecision`

— Keep the full precision of the result.`KeepLSB`

— Keep least significant bits. Specify the product word length, while the fraction length is set to maintain the least significant bits of the product.`KeepMSB`

— Keep most significant bits. Specify the product word length, while the fraction length is set to maintain the most significant bits of the product.`SpecifyPrecision`

— Specify the word and fraction lengths or slope and bias of the product.

`ProductSlope`

— Slope of the product data type

`9.3132e-010`

(default) | floating-point number

Slope of the product data type, specified as a floating-point number.

**Note**

$$ProductSlope=ProductSlopeAdjustmentFactor\times {2}^{ProductFixedExponent}$$

Changing one of these properties affects the others.

`ProductSlopeAdjustmentFactor`

— Slope adjustment factor of the product data type

`1`

(default) | floating-point number greater than or equal to 1 and less than 2

Slope adjustment factor of the product data type, specified as a floating-point number greater than or equal to 1 and less than 2.

**Note**

$$ProductSlope=ProductSlopeAdjustmentFactor\times {2}^{ProductFixedExponent}$$

Changing one of these properties affects the others.

`ProductWordLength`

— Word length of the product data type in bits

`32`

(default) | positive integer

Word length of the product data type in bits, specified as a positive integer.

## Rounding and Overflow Properties

`OverflowAction`

— Action to take on overflow

`Saturate`

(default) | `Wrap`

Action to take on overflow, specified as one of these values:

`Saturate`

— Saturate to maximum or minimum value of the fixed-point range on overflow.`Wrap`

— Wrap on overflow. This mode is also known as two's complement overflow.

`RoundingMethod`

— Rounding method to use

`Nearest`

(default) | `Ceiling`

| `Convergent`

| `Zero`

| `Floor`

| `Round`

Rounding method to use, specified as one of the following:

`Nearest`

— Round toward nearest. Ties round toward positive infinity.`Ceiling`

— Round toward positive infinity.`Convergent`

— Round toward nearest. Ties round to the nearest even stored integer (least biased).`Zero`

— Round toward zero.`Floor`

— Round toward negative infinity.`Round`

— Round toward nearest. Ties round toward negative infinity for negative numbers, and toward positive infinity for positive numbers.

## Version History

**Introduced before R2006a**

## MATLAB 명령

다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.

명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)