看到帮助文件上面说single类型的数据在内存中是这样存储的:
The Single typeA 4-byte (32-bit) Single number is divided into three fields
----------------------------------------
1            8                 23
----------------------------------------
s            e                 f
-----------------------------------------
The value v of the number is given byif 0 < e < 255, then v = (-1)^s * 2^(e-127) * (1.f )
if e = 0 and f <> 0, then v = (-1)^s * 2^(-126) * (0.f )
if e = 0 and f = 0, then v = (-1)^s * 0
if e = 255 and f = 0, then v = (-1)^s * Inf
if e = 255 and f <> 0, then v is a NaN
我实验了一下,好像按照他的这个公式算出来,差的很多呀:
  sinY:=-28.78;
  writeln('',sinY);
  writeln('',inttohex(integer(@sinY),8));
  readln;
查看到sinY的内存地址是$40A79C,内存中的数据是:C1 E6 3D 71;
按照上面的公式计算下来应该是26.72064
这怎么会呢?