Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Addition/Addition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ static void Main(string[] args)
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
decimal v1 = decimal.MaxValue;
decimal v2 = decimal.MaxValue;
Console.WriteLine("Type: {0}", v1.GetType().Name);
Console.WriteLine("1. Value of v1 = {0}", v1);
v1 = v2+v1;
Console.WriteLine("2. Value of v1 = {0}", v1);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
uint v1 = uint.MaxValue;
uint v2 = uint.MaxValue;
Expand Down
File renamed without changes.
File renamed without changes.
140 changes: 140 additions & 0 deletions Division/Division.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
namespace MathFun
{
using System;
class Division
{
static void Main(string[] args)
{
try
{
float de = 0;
float nu = 1;
Console.WriteLine("Type: {0}", de.GetType().Name);
Console.WriteLine("1. Value of de = {0}", de);
de = nu/de;
Console.WriteLine("2. Value of de = {0}", de);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
double de = 0;
double nu = 1;
Console.WriteLine("Type: {0}", de.GetType().Name);
Console.WriteLine("1. Value of de = {0}", de);
de = nu/de;
Console.WriteLine("2. Value of de = {0}", de);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
decimal de = 0;
decimal nu = 1;
Console.WriteLine("Type: {0}", de.GetType().Name);
Console.WriteLine("1. Value of de = {0}", de);
de = nu/de;
Console.WriteLine("2. Value of de = {0}", de);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
uint de = 0;
uint nu = 1;
Console.WriteLine("Type: {0}", de.GetType().Name);
Console.WriteLine("1. Value of de = {0}", de);
de = nu/de;
Console.WriteLine("2. Value of de = {0}", de);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
int de = 0;
int nu = 1;
Console.WriteLine("Type: {0}", de.GetType().Name);
Console.WriteLine("1. Value of de = {0}", de);
de = nu/de;
Console.WriteLine("2. Value of de = {0}", de);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
short de = 0;
short nu = 1;
Console.WriteLine("Type: {0}", de.GetType().Name);
Console.WriteLine("1. Value of de = {0}", de);
de = (short)(nu/de);
Console.WriteLine("2. Value of de = {0}", de);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
ushort de = 0;
ushort nu = 1;
Console.WriteLine("Type: {0}", de.GetType().Name);
Console.WriteLine("1. Value of de = {0}", de);
de = (ushort)(nu/de);
Console.WriteLine("2. Value of de = {0}", de);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
long de = 0;
long nu = 1;
Console.WriteLine("Type: {0}", de.GetType().Name);
Console.WriteLine("1. Value of de = {0}", de);
de = (long)nu/de;
Console.WriteLine("2. Value of de = {0}", de);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
ulong de = 0;
ulong nu = 1;
Console.WriteLine("Type: {0}", de.GetType().Name);
Console.WriteLine("1. Value of de = {0}", de);
de = (ulong)nu/de;
Console.WriteLine("2. Value of de = {0}", de);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
byte de = 0;
byte nu = 1;
Console.WriteLine("Type: {0}", de.GetType().Name);
Console.WriteLine("1. Value of de = {0}", de);
de = (byte)(nu/de);
Console.WriteLine("2. Value of de = {0}", de);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
}
}
}
60 changes: 60 additions & 0 deletions Division/ZeroDivision/02Division.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1857E1A4-E781-4B07-B011-AE806BFB4CCA}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MathFun</RootNamespace>
<AssemblyName>Division</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Division.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
6 changes: 6 additions & 0 deletions Division/ZeroDivision/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
File renamed without changes.
36 changes: 36 additions & 0 deletions Division/ZeroDivision/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Division")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Division")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1857e1a4-e781-4b07-b011-ae806bfb4cca")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
7 changes: 6 additions & 1 deletion MathFun.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02Division", "ZeroDivision\02Division.csproj", "{1857E1A4-E781-4B07-B011-AE806BFB4CCA}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02Division", "Division\02Division.csproj", "{1857E1A4-E781-4B07-B011-AE806BFB4CCA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "01Multiplication", "Multiplication\01Multiplication.csproj", "{409B1EBC-C517-4F25-BAF8-6ECA2D8F6FC9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "03Addition", "Addition\03Addition.csproj", "{73E4B5C9-FE2D-48B2-AC78-65B502DB286F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "04Subtruction", "Subtruction\04Subtruction.csproj", "{D538E16D-F058-4955-8240-6EA1E651A051}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7D56DBD8-730C-40A9-9235-BEAEF23545E0}"
ProjectSection(SolutionItems) = preProject
ReadMe.md = ReadMe.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
13 changes: 13 additions & 0 deletions Multiplication/Multiplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ static void Main(string[] args)
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
decimal v1 = decimal.MaxValue;
decimal v2 = decimal.MaxValue;
Console.WriteLine("Type: {0}", v1.GetType().Name);
Console.WriteLine("1. Value of v1 = {0}", v1);
v1 = v2 * v1;
Console.WriteLine("2. Value of v1 = {0}", v1);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
uint v1 = uint.MaxValue;
uint v2 = uint.MaxValue;
Expand Down
37 changes: 36 additions & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
Math fun
Math fun



ECMA-334
4th Edition / June 2006
C# Language Specification

8.2.1 Predefined types

Type Description Example
object The ultimate base type of all other types object o = null;
string String type; a string is a sequence of Unicode
code units string s = "hello";
sbyte 8-bit signed integral type sbyte val = 12;
short 16-bit signed integral type short val = 12;
int 32-bit signed integral type int val = 12;
long 64-bit signed integral type long val1 = 12;
long val2 = 34L;
byte 8-bit unsigned integral type byte val1 = 12;
ushort 16-bit unsigned integral type ushort val1 = 12;
uint 32-bit unsigned integral type uint val1 = 12;
uint val2 = 34U;
ulong 64-bit unsigned integral type ulong val1 = 12;
ulong val2 = 34U;
ulong val3 = 56L;
ulong val4 = 78UL;
float Single-precision floating point type float val = 1.23F;
double Double-precision floating point type double val1 = 1.23;
double val2 = 4.56D;
bool Boolean type; a bool value is either
true or false bool val1 = true;
bool val2 = false;
char Character type; a char value is
a Unicode code unit char val = 'h';
decimal Precise decimal type with at least 28 significant digits decimal val = 1.23M; This is attempt to systematically account for such cases as division by zero, overflow, underflow, and handling of NaNby predefined C Sharp programming numeric data types.As well as provide for systemic ordered understanding of how CIL .NET programming language will translate and handleeach data type and its respective arithmetic operation.In the end this is to better evaluate options and performance of each choice, as application implementation demandsin the future.
Expand Down
13 changes: 13 additions & 0 deletions Subtruction/Subtruction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ static void Main(string[] args)
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
decimal v1 = decimal.MaxValue;
decimal v2 = decimal.MinValue;
Console.WriteLine("Type: {0}", v1.GetType().Name);
Console.WriteLine("1. Value of v1 = {0}", v1);
v1 = v2-v1;
Console.WriteLine("2. Value of v1 = {0}", v1);
}
catch (Exception ex)
{
Console.WriteLine("Exception Message: {0}", ex.Message);
}
try
{
uint v1 = uint.MaxValue;
uint v2 = uint.MinValue;
Expand Down