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. is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c:严格输入了匹配通配符,但还是找不到元素“jee:jndi-lookup”的声明。

    由于未添加xsd声明引起

  2. java获取文件大小的方法

    目前Java获取文件大小的方法有两种: 1.通过file的length()方法获取: 2.通过流式方法获取: 通过流式方法又有两种,分别是旧的java.io.*中FileInputStream的ava ...

  3. ASP.net Substitution 页面缓存而部分不缓存的实现方法

    在ASP.NET中要实现部分内容非缓存,而其它的都需要缓存输出,可以使用Substitution控件实现. <%@ Page Language="C#" AutoEventW ...

  4. Django 的路由层URL 分组 路由分发 反向解析

    URL配置(URLconf)就像Django 所支撑网站的目录.它的本质是URL与要为该URL调用的视图函数之间的映射表:你就是以这种方式告诉Django,对于这个URL调用这段代码,对于那个URL调 ...

  5. [翻译] KVNProgress

    KVNProgress KVNProgress is a fully customizable progress HUD that can be full screen or not. KVNProg ...

  6. 最优化作业 共轭梯度法 matlab代码

    syms f x1 x2 f=(1/2)*x1^2+x2^2; x=[2;1]; a=[1 0;0 2];% A g1=diff(f,x1); g2=diff(f,x2); g=[g1;g2];%导数 ...

  7. December 27th 2016 Week 53rd Tuesday

    A journey of one thousand miles begins with one step. 千里之行始于足下. No matter how slowly you walk, as lo ...

  8. [Codeup 25482] Beauty

    25482: Beauty 时间限制: 1 Sec  内存限制: 128 MB献花: 7  解决: 3[献花][花圈][TK题库] 题目描述 一年一度的星哥选美又拉开了帷幕 N个人报名参加选拔,每个人 ...

  9. Homebrew 安装 MySQL

    安装 Homebrew brew doctor 确认 brew 在正常工作 brew update 更新包 brew install mysql 安装 MySQL ​ ==> Downloadi ...

  10. BT提权wind2008R2

    昨天中午打开电脑,对着菜刀在那翻啊翻,找到一个64bit的os. 因为这个ip不在曾经提权过的主机列表里面,心想这应该是个低权限的网站,顺手打个whoami试试,结果给我返回了"nt aut ...