Main Content

固定小数点オブジェクトの numerictype

numerictype オブジェクトのプロパティに有効な値

numerictype オブジェクトには固定小数点オブジェクトのすべてのデータ型とスケーリングの属性が含まれています。numerictype オブジェクトの動作は MATLAB® オブジェクトと同じですが、定義済みのフィールドに有効な値のみを設定できる点が異なります。以下の表にオブジェクトの各フィールドの可能な設定を示します。

メモ

fi オブジェクトを作成する場合、numerictype オブジェクトの指定されていないフィールドは既定値に戻ります。このため、DataTypeModeunspecified scaling に設定されている場合、fi オブジェクトが作成されると既定の binary point scaling になります。numerictype オブジェクトの Signedness プロパティが Auto に設定されている場合、fi オブジェクトが作成されると既定の Signed になります。

DataTypeModeDataTypeスケーリング符号属性Word-
Length
Fraction-
Length
SlopeBias

固定小数点データ型

Fixed-point: binary point scaling

Fixed

BinaryPoint

Signed
Unsigned
Auto

1 ~ 65,535 の正の整数

正または負の整数

2^(-小数部の長さ)

0

Fixed-point: slope and bias scaling

Fixed

SlopeBias

Signed
Unsigned
Auto

1 ~ 65,535 の正の整数

N/A

ゼロより大きい任意の浮動小数点数

任意の浮動小数点数

Fixed-point: unspecified scaling

Fixed

Unspecified

Signed
Unsigned
Auto

1 ~ 65,535 の正の整数

N/A

N/A

N/A

スケーリングされた double データ型

Scaled double: binary point scaling

ScaledDouble

BinaryPoint

Signed
Unsigned
Auto

1 ~ 65,535 の正の整数

正または負の整数

2^(-小数部の長さ)

0

Scaled double: slope and bias scaling

ScaledDouble

SlopeBias

Signed
Unsigned
Auto

1 ~ 65,535 の正の整数

N/A

ゼロより大きい任意の浮動小数点数

任意の浮動小数点数

Scaled double: unspecified scaling

ScaledDouble

Unspecified

Signed
Unsigned
Auto

1 ~ 65,535 の正の整数

N/A

N/A

N/A

組み込みデータ型

Double

double

N/A

1
true

64

0

1

0

Single

single

N/A

1
true

32

0

1

0

Boolean

boolean

N/A

0
false

1

0

1

0

fi オブジェクトの作成後に、fi オブジェクトの numerictype プロパティを変更することはできません。

勾配に影響するプロパティ

numerictype オブジェクトの Slope フィールドと、SlopeAdjustmentFactor プロパティおよび FixedExponent プロパティには、次の関係があります。

slope=slope adjustment factor×2fixed exponent

FixedExponent プロパティと FractionLength プロパティには、次の関係があります。

fixed exponent=fraction length

SlopeAdjustmentFactor プロパティ、FixedExponent プロパティ、または FractionLength プロパティを設定すると、Slope フィールドが変更されます。

格納整数値と実際値

2 進小数点スケーリングでは、numerictypeStoredIntegerValue プロパティと RealWorldValue プロパティには次の関係があります。

real-world value=stored integer value×2-fraction length

[勾配 バイアス] スケーリングでは、RealWorldValue は次のように表すことができます。

real-world value=            stored integer value×(slope adjustment factor×2fixed exponent)+bias

これは、以下と等価です。

real-world value=(slope×stored integer)+bias

これらのプロパティのいずれかを更新すると、それに合わせて他のプロパティも変更されます。

関連するトピック