Quickly defines the mathematical constant PI and uses it in a simple calculation.

ID: 286

				
					using uCalcSoftware;

var uc = new uCalc();
uc.DefineConstant("PI = 3.14159");
Console.WriteLine(uc.Eval("2 * PI"));
				
			
6.28318
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   uc.DefineConstant("PI = 3.14159");
   cout << uc.Eval("2 * PI") << endl;
}
				
			
6.28318
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      uc.DefineConstant("PI = 3.14159")
      Console.WriteLine(uc.Eval("2 * PI"))
   End Sub
End Module
				
			
6.28318