资源简介
基于Laura.Compute开发的C#win窗口科学计算器程序。

代码片段和文件信息
/**
*@项目名称: C#科学计算器
*@Date: 2015.10.26
*@author:enverer 775004030@qq.com
*本项目开放源代码,读者可自由查看、修改、使用、发布
*如果有想法可联系作者
*本代码为学校中的一次作业,之后并不会再维护
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Laura.Compute;
namespace Calculator
{
public partial class Form1 : Form
{
private double saver;
private bool isShift;
private double ANS;
public Form1()
{
InitializeComponent();
saver = 0;
isShift = false;
ANS = 0;
}
private double factor(double n)
{
double result = 1;
while (n >= 1)
{
result *= n--;
}
return result;
}
private void FindInsideLast(int posstring textcal string name out int last)//找到函数的参数
{
last = 0; ;
int length = name.Length;
int n = 1;//未匹配的左括号个数
for (int i = pos + length; i < textcal.Length; i++)
{
if (textcal[i] == ‘(‘)
{
n++;
}
if (textcal[i] == ‘)‘)
{
n--;
}
if (n == 0)
{
last = i;
break;
}
}
}
//找到!前的数字
private void Res_Findnumber(string textcal int index out double number)
{
int i;
for (i = index - 1; i >= 0; i--)
{
if (!Char.IsDigit(textcal[i]) && (textcal[i] != ‘.‘))
break;
}
number = Double.Parse(textcal.Substring(i + 1 index - i - 1));
}
private string Preformat(String textcal)
{
textcal.Replace(“ “ ““);//去除所有空格
textcal = textcal.Replace(“e“ Math.E.ToString());//将e替换为数字
textcal = textcal.Replace(“e“ Math.E.ToString());//将π替换为数字
textcal = textcal.Replace(“ANS“ ANS.ToString());//将ANS替换为数字
int pos = 0;
while ((pos = textcal.IndexOf(“!“)) != -1)//处理阶乘
{
double num;
Res_Findnumber(textcal pos out num);
double result = factor(num);
textcal = textcal.Replace(num.ToString() + “!“ result.ToString());
}
//处理arcsin
while ((pos = textcal.IndexOf(“arcsin(“)) != -1)
{
string name = “arcsin(“;
int last;
FindInsideLast(pos textcal name out last);
double result = Math.Asin(Double.Parse(Compute(textcal.Substring(pos + name.Length last - pos - na
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-10-25 10:49 Calculator\
目录 0 2015-10-26 15:08 Calculator\Calculator\
文件 2842 2015-10-25 10:57 Calculator\Calculator.sln
文件 95744 2015-10-26 15:08 Calculator\Calculator.v12.suo
文件 187 2015-10-20 09:55 Calculator\Calculator\App.config
目录 0 2015-10-25 20:16 Calculator\Calculator\bin\
目录 0 2015-10-25 10:58 Calculator\Calculator\bin\Debug\
文件 43520 2015-10-25 20:07 Calculator\Calculator\bin\Debug\Calculator.exe
文件 187 2015-10-20 09:55 Calculator\Calculator\bin\Debug\Calculator.exe.config
文件 50688 2015-10-25 20:07 Calculator\Calculator\bin\Debug\Calculator.pdb
文件 23168 2015-10-25 20:09 Calculator\Calculator\bin\Debug\Calculator.vshost.exe
文件 187 2015-10-20 09:55 Calculator\Calculator\bin\Debug\Calculator.vshost.exe.config
文件 490 2010-03-17 22:39 Calculator\Calculator\bin\Debug\Calculator.vshost.exe.manifest
文件 83968 2015-10-25 17:43 Calculator\Calculator\bin\Debug\Laura.Compute.dll
文件 292352 2015-10-25 17:43 Calculator\Calculator\bin\Debug\Laura.Compute.pdb
文件 15872 2015-10-25 10:57 Calculator\Calculator\bin\Debug\Laura.Compute.Test.exe
文件 28160 2015-10-25 10:57 Calculator\Calculator\bin\Debug\Laura.Compute.Test.pdb
目录 0 2015-10-26 12:18 Calculator\Calculator\bin\Release\
文件 42496 2015-10-26 15:08 Calculator\Calculator\bin\Release\Calculator.exe
文件 187 2015-10-20 09:55 Calculator\Calculator\bin\Release\Calculator.exe.config
文件 48640 2015-10-26 15:08 Calculator\Calculator\bin\Release\Calculator.pdb
文件 23168 2015-10-26 15:08 Calculator\Calculator\bin\Release\Calculator.vshost.exe
文件 187 2015-10-20 09:55 Calculator\Calculator\bin\Release\Calculator.vshost.exe.config
文件 490 2010-03-17 22:39 Calculator\Calculator\bin\Release\Calculator.vshost.exe.manifest
文件 77312 2015-10-25 20:17 Calculator\Calculator\bin\Release\Laura.Compute.dll
文件 220672 2015-10-25 20:17 Calculator\Calculator\bin\Release\Laura.Compute.pdb
文件 15360 2015-10-25 20:17 Calculator\Calculator\bin\Release\Laura.Compute.Test.exe
文件 26112 2015-10-25 20:17 Calculator\Calculator\bin\Release\Laura.Compute.Test.pdb
文件 5665 2015-10-25 20:17 Calculator\Calculator\Calculator.csproj
文件 453 2015-10-25 20:17 Calculator\Calculator\Calculator.csproj.user
文件 15178 2015-10-26 15:08 Calculator\Calculator\Form1.cs
............此处省略179个文件信息
- 上一篇:仿QQ聊天系统,基于C#的实现
- 下一篇:ASP.NET/C#超市库存管理系统
相关资源
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
- c# 高校档案信息管理系统
- c#向word文件插入图片
评论
共有 条评论