procedure TForm1.cmd2Click(Sender: TObject);
var
str1, str2: string;
LValue1: Double;
LValue2: Extended;
LFactor1: Double;
LFactor2: Extended;
begin
LFactor1 := 0.1;
LFactor2 := 0.1;
LValue1 := 0.15;
LValue2 := 0.15;
LValue1 := (LValue1 / LFactor1) + 0.5;
LValue2 := (LValue2 / LFactor2) + 0.5;
LValue1 := Int(LValue1);                    //为什么Int(2)=1???
LValue2 := Int(LValue2);
LValue1 := LValue1 * LFactor1;
LValue2 := LValue2 * LFactor2;
str1 := FloatToStr(LValue1);
str2 := FloatToStr(LValue2);
ShowMessage(str1 + '|' + str2);
end;

DELPHI DOUBLE不解之迷的更多相关文章

  1. 转:Delphi 6 实用函数

    来自: daocaoren0824, 时间: -- ::, ID: 再给你一份 程序员实用函数 {▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎▎} {▎ ▎} {▎ 大 ...

  2. ArcEngine地图窗口指定区域导出指定DPI多格式---delphi/C#实现

    delphi/C#实现,其他语言稍微改下就行了.AE的编码各个语言都差不多,这里也没用到某一语言的特性. 函数特点: 1.可以精确导出指定范围的图形要素 2.支持多格式.TIF, .EMF,.GIF, ...

  3. float和double的精度

    作者: jillzhang 联系方式:jillzhang@126.com 原网址:http://blog.csdn.net/wuna66320/article/details/1691734 1 范围 ...

  4. Delphi、C C++、Visual Basic数据类型的对照 转

    Delphi.C C++.Visual  Basic数据类型的对照 变量类型 Delphi C/C++ Visual Basic 位有符号整数 ShortInt char -- 位无符号整数 Byte ...

  5. delphi.指针.PChar

    此文是delphi.指针.应用姊妹篇,想细化一下PChar应用,所以有了此文. 注意: 1:此文讲的是PChar与字符串相关操作,其它方法暂不多讲. 2:由于D分开Ansi/Unicode的两种完全不 ...

  6. Delphi编写DLL供C#调用的实例

    Delphi中编写的Dll: library TestDLL; { Important note about DLL memory management: ShareMem must be the f ...

  7. Delphi 调用Dll的两种方式

    unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System ...

  8. Delphi日期函数、日期加减

    Delphi里有现成的函数可以实现日期加减,是在DateUtils单元里的. function IncYear(const AValue: TDateTime; const ANumberOfYear ...

  9. delphi数据类型及占用的字节数 C++ 对应数据类型

    delphi byte:1个字节. int/Integer: long: long long:8字节,64位 shortInt:2字节,16位 LongInt:4字节,32位 Int64:8字节,64 ...

随机推荐

  1. spring boot(3)-Rest风格接口

    Rest接口 虽然现在还有很多人在用jsp,但是其实这种动态页面早已过时,现在前端流行的是静态HTML+ rest接口(json格式).当然,如果是单台服务器,用动态还是静态页面可能没什么很大区别,但 ...

  2. Android数据统计

    开发效率可以用这些方式提升: 1 . 构建公用工具类,方便大家使用 2 . 使用开源的一些包,例如ORM思想的数据库等 3 . 可以很快的找到问题.开发中,找bug的时间,往往是很多的.我用的方法有3 ...

  3. 解决nginx使用proxy_pass反向代理时,session丢失的问题

       这2天在测试Nginx作为反向代理到Tomcat应用时,session丢失的问题.经过一系列查看官方文档和测试,发现如下:1.如果只是host.端口转换,则session不会丢失.例如:     ...

  4. Andriod(3)——Understanding Android Resources

    Now, we will follow that introduction with an in-depth look at Android SDK fundamentals and cover re ...

  5. linux邮件客户端mutt日志文件,发不出邮件

    linux上面使用很方便的收发邮件客户端(即MUA),还有一个是mail,大家也可以试试. 在网上找了很多,都说需要msmtp配合使用,其实mutt里面也内建了smtp支持的. mutt and SM ...

  6. Hibernate 一次查询分多次返回 避免内存溢出

    public void grpcGpioDevice(StreamObserver<NI_GetAllDeviceListResponse> responseObserver, Map&l ...

  7. Id vs Instancetype

    我写了一篇 Id vs Instancetype的文章,欢迎访问!

  8. IntelliJ IDEA常用设置(转)

    IntelliJ IDEA是一款非常优秀的JAVA编辑器,初学都可会对其中的一些做法感到很别扭,刚开始用的时候我也感到很不习惯,在参考了网上一些文章后在这里把我的一些经验写出来,希望初学者能快速适应它 ...

  9. Python中根据提供的日期,返回是一年中的第几天

    # coding = utf-8 import datetime dd = raw_input("Please enter date , format is YYYYMMDD:") ...

  10. 查看SQL运行时间

    set @d=now(); select * from table; select timestampdiff(second,@d,now());