如何用Delphi来实现这个公式计算
解决方案 »
- list index out of bounds(0) 为什么?
- ☆★★腾空720度大翻转 急求645规约读电表总电量的例子!!★★☆顶者有分
- Database Desktop可以打开qq用到的那些数据库吗?
- 给大家欣赏一个真正的Delphi解释器(含Source可下载)
- 高分请教-----做一个视频聊天的程序都要用到什么技术?
- 求助 SendMessage 如何模拟鼠标点击WebBrowser1 不了解怎样点
- 怎样编程实现在ListBox里显示数据库表中一个列?(绝对放分)
- 被“美丽心灵”唤醒的数学天才(转载)
- 给字符串某位赋值怎么出错了???
- Coolmenu Standard v3.07.2 password地址:http://www.ukrcom.kherson.ua/~art/cm/cm_std_src.exe
- dbchart显示节点值得问题
- Delphi2010程序编译成功,不能debug
unit TestCalMathMain;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters,
cxContainer, cxEdit, StdCtrls, cxTextEdit, cxMaskEdit, cxSpinEdit, acPNG,
ExtCtrls;type
TForm1 = class(TForm)
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
cxSpinEdit_S: TcxSpinEdit;
cxSpinEdit_L: TcxSpinEdit;
cxSpinEdit_r: TcxSpinEdit;
cxSpinEdit_σ: TcxSpinEdit;
cxSpinEdit_T: TcxSpinEdit;
Button1: TButton;
Label_d1: TLabel;
Label_d2: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
d1, d2: Double;
begin
d1 := (ln(cxSpinEdit_S.Value / cxSpinEdit_L.Value) + ((cxSpinEdit_r.Value + (0.5 * sqr(cxSpinEdit_σ.Value)))
* cxSpinEdit_T.Value)) / (cxSpinEdit_σ.Value * sqrt(cxSpinEdit_T.Value));
Label_d1.Caption := format('d1 = %.4f', [d1]);
d2 := (ln(cxSpinEdit_S.Value / cxSpinEdit_L.Value) + ((cxSpinEdit_r.Value - (0.5 * sqr(cxSpinEdit_σ.Value)))
* cxSpinEdit_T.Value)) / (cxSpinEdit_σ.Value * sqrt(cxSpinEdit_T.Value));
Label_d2.Caption := format('d2 = %.4f', [d2]);
end;