System.TFloatSpecial

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

TFloatSpecial = ( fsZero, fsNZero, fsDenormal, fsNDenormal,
fsPositive, fsNegative, fsInf, fsNInf, fsNaN );

C++

enum DECLSPEC_DENUM TFloatSpecial : unsigned char { fsZero, fsNZero, fsDenormal, fsNDenormal, fsPositive, fsNegative, fsInf, fsNInf, fsNaN };

プロパティ

種類 可視性 ソース ユニット
enum public
System.pas
System.hpp
System System


説明

特別な浮動小数点値を表します。

TFloatSpecial は、特別な種類の浮動小数点値を指定するために使われます。次の表にこの分類を示します。

定数 説明
fsZero 正のゼロ(+0.0)
fsNZero 負のゼロ(-0.0)
fsDenormal 正の非正規化値
fsNDenormal 負の非正規化値
fsPositive 正の値
fsNegative 負の値
fsInf 正の無限大
fsNInf 負の無限大
fsNaN 非数値(表現できない値)

メモ: 非正規化浮動小数点値は、本質的にまったくの概略値です。計算によって非正規化浮動小数点値が得られた場合には、精度が大きく損なわれています。

var
  F: TSingleRec;
  C: TFloatSpecial;

begin
  F := TSingleRec(-0.0);
  C := F.SpecialType; // C は fsNZero

  F := TSingleRec(5e-40);
  C := F.SpecialType; // C は fsDenormal

  // ...

関連項目