mathtypes.~pas

来自「以面向对象方法实现的数值算法类库」· ~PAS 代码 · 共 40 行

~PAS
40
字号
{-------------------------------------------------------------------------------
Unit MathTypes
  数学类型:本单元定义常用数值算法所涉及的基础类型
-------------------------------------------------------------------------------}
unit MathTypes;

interface

  Uses SysUtils;

type

  // TFloat is the basic library floating point type. Use single for single
  // precision (4 bytes) or double for more demanding, double precision (8 bytes)
  TFloat = double;//single;

  // Complex numbers, with precision specified in TFloat (Types unit)
  TComplex = packed record
    Re: TFloat; // Real part
    Im: TFloat; // Imaginary part
  end;

  // 复数数组
  TComplexArray = Array of TComplex;

  // 实数数组
  TFloatArray = Array of TFloat;

  // 矩阵
  TFloatMatrix = Array of TFloatArray;

  // 异常
  EMathException = class(Exception);

const

  // Zero value
  ComplexZero: TComplex = (Re: 0.0; Im: 0.0);

  // Single ranges from 1.5 x 10^

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?