cs-calculator's People
cs-calculator's Issues
冪乗
階乗の計算方式を応用する
ex. 正規表現 など
πの実数表現
πを、
- 三角関数の中に含まれる時には、実数に変換せず計算する
- それ以外の時は、
Math.PI
に変換してから計算する
数字や文字の入力(ボタン)
- 演算子を入力したあとから、不具合が発生する
- そもそもの入力に問題あり、正しく式が表示されない
根号
冪乗の 1/2乗 ver
4桁まで計算 ex. √1600 = 40
(演算子有も含めるので、計8つ書く)
@"[√](\d{1})[+-×÷]"
@"[√](\d{2})[+-×÷]"
@"[√](\d{3})[+-×÷]"
@"[√](\d{4})[+-×÷]"
階乗
正規表現を使った文字列の検索でいい感じに抽出できないか。
使用しているメソッドでは 170! までしか計算ができないので、3桁まで検索をかけている
^(\d{任意の数字})?
で桁数を指定可能
//1桁
var match_1 = Regex.Matches(pattern, @"^(\d{1})?[!]");
foreach (Match match_factr1 in match_1)
{
Console.WriteLine("正規表現 1 : " + match_factr1.Value);
}
//演算子有
var match_1_ope = Regex.Matches(pattern, @"[+-×÷]\d[!]");
foreach (Match match_factr1_ope in match_1_ope)
{
Console.WriteLine("正規表現 1 a: " + match_factr1_ope.Value);
}
//2桁
var match_2 = Regex.Matches(pattern, @"^(\d{2})?[!]");
foreach (Match match_factr2 in match_2)
{
Console.WriteLine("正規表現 2 : " + match_factr2.Value);
}
//演算子有
var match_2_ope = Regex.Matches(pattern, @"[+-×÷]\d\d[!]");
foreach (Match match_factr2_ope in match_2_ope)
{
Console.WriteLine("正規表現 2 a : " + match_factr2_ope.Value);
}
//3桁
var match_3 = Regex.Matches(pattern, @"\d\d\d[!]");
foreach (Match match_factr3 in match_3)
{
Console.WriteLine("正規表現 3桁 : " + match_factr3.Value);
}
数字や文字の入力(キー)
キーボードを使って、数字や記号の入力が出来るようにする
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.