宇宙仮面の C# プログラミング
   

Top

C# 2005

C# 2003

C# Windows Mobile

SQL Server 2005

SQL Server 2000

Virtual PC/Server

C# 研究室ブログ

C# ソフトウェア ダウンロード

C# 開発環境

宇宙仮面の C# プログラミングについて

.NET/C# eGroup JP

INETA Japan



Google
Web
uchukamen.com









算術計算

開発環境: Visual Studio 2003 

目次

  1. 目次
  2. 目的
  3. 参考書
  4. ソースコード
  5. 実行結果
  6. 改定記録

目的

算術ライブラリ:System.Math です。

System.Math.PIがあるのに、
const float pai = 3.14f;
なんて自分で定義しないように!

参考書

(1) MSDN System.Math

ソースコード

 
using System;

namespace test
{
        /// <summary>
        /// System.Math
        /// </summary>
        class Class1
        {
                static void Main(string[] args)
                {
                        //
                        Console.WriteLine("System.Math.E  = {0}", System.Math.E);
                        Console.WriteLine("System.Math.PI = {0}", System.Math.PI);
                        Console.WriteLine("Sin30 = {0}", System.Math.Sin(System.Math.PI /6 ));
                }
        }
}

実行結果

C:\My Documents\Visual Studio Projects\test1\bin\Release>test1
System.Math.E = 2.71828182845905
System.Math.PI = 3.14159265358979
Sin30 = 0.5

改定記録

 

日付コメント
2004/5/23全体デザイン再構成
2002/3/2初版作成
このページを評価する

このページを評価する

悪い             良い
1 2 3 4 5
コメント(一言お願いします)