Tests for float arithmetic, expressions, IO methods

This commit is contained in:
Alex Dyachenko 2015-05-21 17:18:25 -04:00
parent bf044dc564
commit 4770c42686
5 changed files with 244 additions and 232 deletions

View File

@ -94,15 +94,27 @@
</Otherwise> </Otherwise>
</Choose> </Choose>
<ItemGroup> <ItemGroup>
<None Include="..\..\..\mpir.net\mpir.net-tests\HugeFloatTests\Arithmetic.cs">
<Link>HugeFloatTests\Arithmetic.cs</Link>
</None>
<Compile Include="..\..\..\mpir.net\mpir.net-tests\HugeFloatTests\Assignment.cs"> <Compile Include="..\..\..\mpir.net\mpir.net-tests\HugeFloatTests\Assignment.cs">
<Link>HugeFloatTests\Assignment.cs</Link> <Link>HugeFloatTests\Assignment.cs</Link>
</Compile> </Compile>
<None Include="..\..\..\mpir.net\mpir.net-tests\HugeFloatTests\Comparisons.cs">
<Link>HugeFloatTests\Comparisons.cs</Link>
</None>
<Compile Include="..\..\..\mpir.net\mpir.net-tests\HugeFloatTests\ConstructionAndDisposal.cs"> <Compile Include="..\..\..\mpir.net\mpir.net-tests\HugeFloatTests\ConstructionAndDisposal.cs">
<Link>HugeFloatTests\ConstructionAndDisposal.cs</Link> <Link>HugeFloatTests\ConstructionAndDisposal.cs</Link>
</Compile> </Compile>
<Compile Include="..\..\..\mpir.net\mpir.net-tests\HugeFloatTests\Conversions.cs"> <Compile Include="..\..\..\mpir.net\mpir.net-tests\HugeFloatTests\Conversions.cs">
<Link>HugeFloatTests\Conversions.cs</Link> <Link>HugeFloatTests\Conversions.cs</Link>
</Compile> </Compile>
<None Include="..\..\..\mpir.net\mpir.net-tests\HugeFloatTests\ExpressionTests.cs">
<Link>HugeFloatTests\ExpressionTests.cs</Link>
</None>
<None Include="..\..\..\mpir.net\mpir.net-tests\HugeFloatTests\IO.cs">
<Link>HugeFloatTests\IO.cs</Link>
</None>
<Compile Include="..\..\..\mpir.net\mpir.net-tests\HugeIntTests\Arithmetic.cs"> <Compile Include="..\..\..\mpir.net\mpir.net-tests\HugeIntTests\Arithmetic.cs">
<Link>HugeIntTests\Arithmetic.cs</Link> <Link>HugeIntTests\Arithmetic.cs</Link>
</Compile> </Compile>

View File

@ -1,34 +1,34 @@
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012 # Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_core2", "dll_mpir_core2\dll_mpir_core2.vcxproj", "{6424539a-ba67-11e3-a234-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_core2", "dll_mpir_core2\dll_mpir_core2.vcxproj", "{6424539A-BA67-11E3-A234-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_core2", "lib_mpir_core2\lib_mpir_core2.vcxproj", "{6429d25c-ba67-11e3-99ed-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_core2", "lib_mpir_core2\lib_mpir_core2.vcxproj", "{6429D25C-BA67-11E3-99ED-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_cxx", "lib_mpir_cxx\lib_mpir_cxx.vcxproj", "{64616226-ba67-11e3-b58a-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_cxx", "lib_mpir_cxx\lib_mpir_cxx.vcxproj", "{64616226-BA67-11E3-B58A-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_k8", "dll_mpir_k8\dll_mpir_k8.vcxproj", "{642fed70-ba67-11e3-9442-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_k8", "dll_mpir_k8\dll_mpir_k8.vcxproj", "{642FED70-BA67-11E3-9442-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_k8", "lib_mpir_k8\lib_mpir_k8.vcxproj", "{6435933a-ba67-11e3-80ec-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_k8", "lib_mpir_k8\lib_mpir_k8.vcxproj", "{6435933A-BA67-11E3-80EC-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_nehalem", "dll_mpir_nehalem\dll_mpir_nehalem.vcxproj", "{643b6026-ba67-11e3-9965-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_nehalem", "dll_mpir_nehalem\dll_mpir_nehalem.vcxproj", "{643B6026-BA67-11E3-9965-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_nehalem", "lib_mpir_nehalem\lib_mpir_nehalem.vcxproj", "{6441a25e-ba67-11e3-b8c7-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_nehalem", "lib_mpir_nehalem\lib_mpir_nehalem.vcxproj", "{6441A25E-BA67-11E3-B8C7-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_gc", "lib_mpir_gc\lib_mpir_gc.vcxproj", "{640f6a3e-ba67-11e3-9a67-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_gc", "lib_mpir_gc\lib_mpir_gc.vcxproj", "{640F6A3E-BA67-11E3-9A67-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_gc", "dll_mpir_gc\dll_mpir_gc.vcxproj", "{640668a8-ba67-11e3-9d8e-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_gc", "dll_mpir_gc\dll_mpir_gc.vcxproj", "{640668A8-BA67-11E3-9D8E-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_p3", "dll_mpir_p3\dll_mpir_p3.vcxproj", "{6417f686-ba67-11e3-8727-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_p3", "dll_mpir_p3\dll_mpir_p3.vcxproj", "{6417F686-BA67-11E3-8727-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_p3", "lib_mpir_p3\lib_mpir_p3.vcxproj", "{641e38a2-ba67-11e3-8b68-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_p3", "lib_mpir_p3\lib_mpir_p3.vcxproj", "{641E38A2-BA67-11E3-8B68-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_sandybridge", "dll_mpir_sandybridge\dll_mpir_sandybridge.vcxproj", "{6447963e-ba67-11e3-b03e-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_sandybridge", "dll_mpir_sandybridge\dll_mpir_sandybridge.vcxproj", "{6447963E-BA67-11E3-B03E-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_sandybridge", "lib_mpir_sandybridge\lib_mpir_sandybridge.vcxproj", "{644d8a3a-ba67-11e3-a7f3-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_sandybridge", "lib_mpir_sandybridge\lib_mpir_sandybridge.vcxproj", "{644D8A3A-BA67-11E3-A7F3-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_sandybridge_ivybridge", "dll_mpir_sandybridge_ivybridge\dll_mpir_sandybridge_ivybridge.vcxproj", "{64537e36-ba67-11e3-b98f-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll_mpir_sandybridge_ivybridge", "dll_mpir_sandybridge_ivybridge\dll_mpir_sandybridge_ivybridge.vcxproj", "{64537E36-BA67-11E3-B98F-24FD5238C490}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_sandybridge_ivybridge", "lib_mpir_sandybridge_ivybridge\lib_mpir_sandybridge_ivybridge.vcxproj", "{645a3598-ba67-11e3-8fa3-24fd5238c490}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lib_mpir_sandybridge_ivybridge", "lib_mpir_sandybridge_ivybridge\lib_mpir_sandybridge_ivybridge.vcxproj", "{645A3598-BA67-11E3-8FA3-24FD5238C490}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -38,90 +38,90 @@ Global
Release|x64 = Release|x64 Release|x64 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{32257940-B5C7-11E3-A871-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64 {6424539A-BA67-11E3-A234-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64
{32257940-B5C7-11E3-A871-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64 {6424539A-BA67-11E3-A234-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64
{32257940-B5C7-11E3-A871-24FD5238C490}.Debug|x64.Build.0 = Debug|x64 {6424539A-BA67-11E3-A234-24FD5238C490}.Debug|x64.Build.0 = Debug|x64
{32257940-B5C7-11E3-A871-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64 {6424539A-BA67-11E3-A234-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64
{32257940-B5C7-11E3-A871-24FD5238C490}.Release|x64.ActiveCfg = Release|x64 {6424539A-BA67-11E3-A234-24FD5238C490}.Release|x64.ActiveCfg = Release|x64
{32257940-B5C7-11E3-A871-24FD5238C490}.Release|x64.Build.0 = Release|x64 {6424539A-BA67-11E3-A234-24FD5238C490}.Release|x64.Build.0 = Release|x64
{322AA9D8-B5C7-11E3-A6DC-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64 {6429D25C-BA67-11E3-99ED-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64
{322AA9D8-B5C7-11E3-A6DC-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64 {6429D25C-BA67-11E3-99ED-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64
{322AA9D8-B5C7-11E3-A6DC-24FD5238C490}.Debug|x64.Build.0 = Debug|x64 {6429D25C-BA67-11E3-99ED-24FD5238C490}.Debug|x64.Build.0 = Debug|x64
{322AA9D8-B5C7-11E3-A6DC-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64 {6429D25C-BA67-11E3-99ED-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64
{322AA9D8-B5C7-11E3-A6DC-24FD5238C490}.Release|x64.ActiveCfg = Release|x64 {6429D25C-BA67-11E3-99ED-24FD5238C490}.Release|x64.ActiveCfg = Release|x64
{322AA9D8-B5C7-11E3-A6DC-24FD5238C490}.Release|x64.Build.0 = Release|x64 {6429D25C-BA67-11E3-99ED-24FD5238C490}.Release|x64.Build.0 = Release|x64
{902AFE28-B5A4-11E3-ADE9-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|Win32 {64616226-BA67-11E3-B58A-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|Win32
{902AFE28-B5A4-11E3-ADE9-24FD5238C490}.Debug|Win32.Build.0 = Debug|Win32 {64616226-BA67-11E3-B58A-24FD5238C490}.Debug|Win32.Build.0 = Debug|Win32
{902AFE28-B5A4-11E3-ADE9-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64 {64616226-BA67-11E3-B58A-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64
{902AFE28-B5A4-11E3-ADE9-24FD5238C490}.Debug|x64.Build.0 = Debug|x64 {64616226-BA67-11E3-B58A-24FD5238C490}.Debug|x64.Build.0 = Debug|x64
{902AFE28-B5A4-11E3-ADE9-24FD5238C490}.Release|Win32.ActiveCfg = Release|Win32 {64616226-BA67-11E3-B58A-24FD5238C490}.Release|Win32.ActiveCfg = Release|Win32
{902AFE28-B5A4-11E3-ADE9-24FD5238C490}.Release|Win32.Build.0 = Release|Win32 {64616226-BA67-11E3-B58A-24FD5238C490}.Release|Win32.Build.0 = Release|Win32
{902AFE28-B5A4-11E3-ADE9-24FD5238C490}.Release|x64.ActiveCfg = Release|x64 {64616226-BA67-11E3-B58A-24FD5238C490}.Release|x64.ActiveCfg = Release|x64
{902AFE28-B5A4-11E3-ADE9-24FD5238C490}.Release|x64.Build.0 = Release|x64 {64616226-BA67-11E3-B58A-24FD5238C490}.Release|x64.Build.0 = Release|x64
{322FB36C-B5C7-11E3-A3B5-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64 {642FED70-BA67-11E3-9442-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64
{322FB36C-B5C7-11E3-A3B5-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64 {642FED70-BA67-11E3-9442-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64
{322FB36C-B5C7-11E3-A3B5-24FD5238C490}.Debug|x64.Build.0 = Debug|x64 {642FED70-BA67-11E3-9442-24FD5238C490}.Debug|x64.Build.0 = Debug|x64
{322FB36C-B5C7-11E3-A3B5-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64 {642FED70-BA67-11E3-9442-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64
{322FB36C-B5C7-11E3-A3B5-24FD5238C490}.Release|x64.ActiveCfg = Release|x64 {642FED70-BA67-11E3-9442-24FD5238C490}.Release|x64.ActiveCfg = Release|x64
{322FB36C-B5C7-11E3-A3B5-24FD5238C490}.Release|x64.Build.0 = Release|x64 {642FED70-BA67-11E3-9442-24FD5238C490}.Release|x64.Build.0 = Release|x64
{32346EBE-B5C7-11E3-ADCC-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64 {6435933A-BA67-11E3-80EC-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64
{32346EBE-B5C7-11E3-ADCC-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64 {6435933A-BA67-11E3-80EC-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64
{32346EBE-B5C7-11E3-ADCC-24FD5238C490}.Debug|x64.Build.0 = Debug|x64 {6435933A-BA67-11E3-80EC-24FD5238C490}.Debug|x64.Build.0 = Debug|x64
{32346EBE-B5C7-11E3-ADCC-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64 {6435933A-BA67-11E3-80EC-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64
{32346EBE-B5C7-11E3-ADCC-24FD5238C490}.Release|x64.ActiveCfg = Release|x64 {6435933A-BA67-11E3-80EC-24FD5238C490}.Release|x64.ActiveCfg = Release|x64
{32346EBE-B5C7-11E3-ADCC-24FD5238C490}.Release|x64.Build.0 = Release|x64 {6435933A-BA67-11E3-80EC-24FD5238C490}.Release|x64.Build.0 = Release|x64
{32395136-B5C7-11E3-95C8-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64 {643B6026-BA67-11E3-9965-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64
{32395136-B5C7-11E3-95C8-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64 {643B6026-BA67-11E3-9965-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64
{32395136-B5C7-11E3-95C8-24FD5238C490}.Debug|x64.Build.0 = Debug|x64 {643B6026-BA67-11E3-9965-24FD5238C490}.Debug|x64.Build.0 = Debug|x64
{32395136-B5C7-11E3-95C8-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64 {643B6026-BA67-11E3-9965-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64
{32395136-B5C7-11E3-95C8-24FD5238C490}.Release|x64.ActiveCfg = Release|x64 {643B6026-BA67-11E3-9965-24FD5238C490}.Release|x64.ActiveCfg = Release|x64
{32395136-B5C7-11E3-95C8-24FD5238C490}.Release|x64.Build.0 = Release|x64 {643B6026-BA67-11E3-9965-24FD5238C490}.Release|x64.Build.0 = Release|x64
{323E0C94-B5C7-11E3-8869-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64 {6441A25E-BA67-11E3-B8C7-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64
{323E0C94-B5C7-11E3-8869-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64 {6441A25E-BA67-11E3-B8C7-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64
{323E0C94-B5C7-11E3-8869-24FD5238C490}.Debug|x64.Build.0 = Debug|x64 {6441A25E-BA67-11E3-B8C7-24FD5238C490}.Debug|x64.Build.0 = Debug|x64
{323E0C94-B5C7-11E3-8869-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64 {6441A25E-BA67-11E3-B8C7-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64
{323E0C94-B5C7-11E3-8869-24FD5238C490}.Release|x64.ActiveCfg = Release|x64 {6441A25E-BA67-11E3-B8C7-24FD5238C490}.Release|x64.ActiveCfg = Release|x64
{323E0C94-B5C7-11E3-8869-24FD5238C490}.Release|x64.Build.0 = Release|x64 {6441A25E-BA67-11E3-B8C7-24FD5238C490}.Release|x64.Build.0 = Release|x64
{3214FD10-B5C7-11E3-80F1-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|Win32 {640F6A3E-BA67-11E3-9A67-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|Win32
{3214FD10-B5C7-11E3-80F1-24FD5238C490}.Debug|Win32.Build.0 = Debug|Win32 {640F6A3E-BA67-11E3-9A67-24FD5238C490}.Debug|Win32.Build.0 = Debug|Win32
{3214FD10-B5C7-11E3-80F1-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64 {640F6A3E-BA67-11E3-9A67-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64
{3214FD10-B5C7-11E3-80F1-24FD5238C490}.Debug|x64.Build.0 = Debug|x64 {640F6A3E-BA67-11E3-9A67-24FD5238C490}.Debug|x64.Build.0 = Debug|x64
{3214FD10-B5C7-11E3-80F1-24FD5238C490}.Release|Win32.ActiveCfg = Release|Win32 {640F6A3E-BA67-11E3-9A67-24FD5238C490}.Release|Win32.ActiveCfg = Release|Win32
{3214FD10-B5C7-11E3-80F1-24FD5238C490}.Release|Win32.Build.0 = Release|Win32 {640F6A3E-BA67-11E3-9A67-24FD5238C490}.Release|Win32.Build.0 = Release|Win32
{3214FD10-B5C7-11E3-80F1-24FD5238C490}.Release|x64.ActiveCfg = Release|x64 {640F6A3E-BA67-11E3-9A67-24FD5238C490}.Release|x64.ActiveCfg = Release|x64
{3214FD10-B5C7-11E3-80F1-24FD5238C490}.Release|x64.Build.0 = Release|x64 {640F6A3E-BA67-11E3-9A67-24FD5238C490}.Release|x64.Build.0 = Release|x64
{320DF77A-B5C7-11E3-9BF6-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|Win32 {640668A8-BA67-11E3-9D8E-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|Win32
{320DF77A-B5C7-11E3-9BF6-24FD5238C490}.Debug|Win32.Build.0 = Debug|Win32 {640668A8-BA67-11E3-9D8E-24FD5238C490}.Debug|Win32.Build.0 = Debug|Win32
{320DF77A-B5C7-11E3-9BF6-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64 {640668A8-BA67-11E3-9D8E-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64
{320DF77A-B5C7-11E3-9BF6-24FD5238C490}.Debug|x64.Build.0 = Debug|x64 {640668A8-BA67-11E3-9D8E-24FD5238C490}.Debug|x64.Build.0 = Debug|x64
{320DF77A-B5C7-11E3-9BF6-24FD5238C490}.Release|Win32.ActiveCfg = Release|Win32 {640668A8-BA67-11E3-9D8E-24FD5238C490}.Release|Win32.ActiveCfg = Release|Win32
{320DF77A-B5C7-11E3-9BF6-24FD5238C490}.Release|Win32.Build.0 = Release|Win32 {640668A8-BA67-11E3-9D8E-24FD5238C490}.Release|Win32.Build.0 = Release|Win32
{320DF77A-B5C7-11E3-9BF6-24FD5238C490}.Release|x64.ActiveCfg = Release|x64 {640668A8-BA67-11E3-9D8E-24FD5238C490}.Release|x64.ActiveCfg = Release|x64
{320DF77A-B5C7-11E3-9BF6-24FD5238C490}.Release|x64.Build.0 = Release|x64 {640668A8-BA67-11E3-9D8E-24FD5238C490}.Release|x64.Build.0 = Release|x64
{321B8D54-B5C7-11E3-91C1-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|Win32 {6417F686-BA67-11E3-8727-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|Win32
{321B8D54-B5C7-11E3-91C1-24FD5238C490}.Debug|Win32.Build.0 = Debug|Win32 {6417F686-BA67-11E3-8727-24FD5238C490}.Debug|Win32.Build.0 = Debug|Win32
{321B8D54-B5C7-11E3-91C1-24FD5238C490}.Debug|x64.ActiveCfg = Debug|Win32 {6417F686-BA67-11E3-8727-24FD5238C490}.Debug|x64.ActiveCfg = Debug|Win32
{321B8D54-B5C7-11E3-91C1-24FD5238C490}.Release|Win32.ActiveCfg = Release|Win32 {6417F686-BA67-11E3-8727-24FD5238C490}.Release|Win32.ActiveCfg = Release|Win32
{321B8D54-B5C7-11E3-91C1-24FD5238C490}.Release|Win32.Build.0 = Release|Win32 {6417F686-BA67-11E3-8727-24FD5238C490}.Release|Win32.Build.0 = Release|Win32
{321B8D54-B5C7-11E3-91C1-24FD5238C490}.Release|x64.ActiveCfg = Release|Win32 {6417F686-BA67-11E3-8727-24FD5238C490}.Release|x64.ActiveCfg = Release|Win32
{32206FB8-B5C7-11E3-9F6F-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|Win32 {641E38A2-BA67-11E3-8B68-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|Win32
{32206FB8-B5C7-11E3-9F6F-24FD5238C490}.Debug|Win32.Build.0 = Debug|Win32 {641E38A2-BA67-11E3-8B68-24FD5238C490}.Debug|Win32.Build.0 = Debug|Win32
{32206FB8-B5C7-11E3-9F6F-24FD5238C490}.Debug|x64.ActiveCfg = Debug|Win32 {641E38A2-BA67-11E3-8B68-24FD5238C490}.Debug|x64.ActiveCfg = Debug|Win32
{32206FB8-B5C7-11E3-9F6F-24FD5238C490}.Release|Win32.ActiveCfg = Release|Win32 {641E38A2-BA67-11E3-8B68-24FD5238C490}.Release|Win32.ActiveCfg = Release|Win32
{32206FB8-B5C7-11E3-9F6F-24FD5238C490}.Release|Win32.Build.0 = Release|Win32 {641E38A2-BA67-11E3-8B68-24FD5238C490}.Release|Win32.Build.0 = Release|Win32
{32206FB8-B5C7-11E3-9F6F-24FD5238C490}.Release|x64.ActiveCfg = Release|Win32 {641E38A2-BA67-11E3-8B68-24FD5238C490}.Release|x64.ActiveCfg = Release|Win32
{3243161C-B5C7-11E3-9E27-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64 {6447963E-BA67-11E3-B03E-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64
{3243161C-B5C7-11E3-9E27-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64 {6447963E-BA67-11E3-B03E-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64
{3243161C-B5C7-11E3-9E27-24FD5238C490}.Debug|x64.Build.0 = Debug|x64 {6447963E-BA67-11E3-B03E-24FD5238C490}.Debug|x64.Build.0 = Debug|x64
{3243161C-B5C7-11E3-9E27-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64 {6447963E-BA67-11E3-B03E-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64
{3243161C-B5C7-11E3-9E27-24FD5238C490}.Release|x64.ActiveCfg = Release|x64 {6447963E-BA67-11E3-B03E-24FD5238C490}.Release|x64.ActiveCfg = Release|x64
{3243161C-B5C7-11E3-9E27-24FD5238C490}.Release|x64.Build.0 = Release|x64 {6447963E-BA67-11E3-B03E-24FD5238C490}.Release|x64.Build.0 = Release|x64
{3247D170-B5C7-11E3-8A62-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64 {644D8A3A-BA67-11E3-A7F3-24FD5238C490}.Debug|Win32.ActiveCfg = Debug|x64
{3247D170-B5C7-11E3-8A62-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64 {644D8A3A-BA67-11E3-A7F3-24FD5238C490}.Debug|x64.ActiveCfg = Debug|x64
{3247D170-B5C7-11E3-8A62-24FD5238C490}.Debug|x64.Build.0 = Debug|x64 {644D8A3A-BA67-11E3-A7F3-24FD5238C490}.Debug|x64.Build.0 = Debug|x64
{3247D170-B5C7-11E3-8A62-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64 {644D8A3A-BA67-11E3-A7F3-24FD5238C490}.Release|Win32.ActiveCfg = Release|x64
{3247D170-B5C7-11E3-8A62-24FD5238C490}.Release|x64.ActiveCfg = Release|x64 {644D8A3A-BA67-11E3-A7F3-24FD5238C490}.Release|x64.ActiveCfg = Release|x64
{3247D170-B5C7-11E3-8A62-24FD5238C490}.Release|x64.Build.0 = Release|x64 {644D8A3A-BA67-11E3-A7F3-24FD5238C490}.Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -20,7 +20,7 @@ along with the MPIR Library. If not, see http://www.gnu.org/licenses/.
using System; using System;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MPIR.Tests.HugeRationalTests namespace MPIR.Tests.HugeFloatTests
{ {
[TestClass] [TestClass]
public class Arithmetic public class Arithmetic
@ -28,11 +28,11 @@ namespace MPIR.Tests.HugeRationalTests
#region Add #region Add
[TestMethod] [TestMethod]
public void RationalAddHugeRational() public void FloatAddHugeFloat()
{ {
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var b = new HugeRational("222987435987982730594288574029879874539/590872612825179551336102196593")) using (var b = new HugeFloat("222987435987982730594288574029879874539/590872612825179551336102196593"))
using (var c = new HugeRational(a + b)) using (var c = new HugeFloat(a + b))
{ {
Assert.AreEqual(a.Numerator * b.Denominator + b.Numerator * a.Denominator, c.Numerator); Assert.AreEqual(a.Numerator * b.Denominator + b.Numerator * a.Denominator, c.Numerator);
Assert.AreEqual(a.Denominator * b.Denominator, c.Denominator); Assert.AreEqual(a.Denominator * b.Denominator, c.Denominator);
@ -40,11 +40,11 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalAddHugeInt() public void FloatAddHugeInt()
{ {
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var b = new HugeInt("222987435987982730594288574029879874539")) using (var b = new HugeInt("222987435987982730594288574029879874539"))
using (var c = new HugeRational(a + b)) using (var c = new HugeFloat(a + b))
{ {
Assert.AreEqual(a.Numerator + b * a.Denominator, c.Numerator); Assert.AreEqual(a.Numerator + b * a.Denominator, c.Numerator);
Assert.AreEqual(a.Denominator, c.Denominator); Assert.AreEqual(a.Denominator, c.Denominator);
@ -55,10 +55,10 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalAddLimb() public void FloatAddLimb()
{ {
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var c = new HugeRational()) using (var c = new HugeFloat())
{ {
var b = 4288574029879874539UL; var b = 4288574029879874539UL;
c.Value = a + b; c.Value = a + b;
@ -68,10 +68,10 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalAddToLimb() public void FloatAddToLimb()
{ {
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var c = new HugeRational()) using (var c = new HugeFloat())
{ {
var b = 4288574029879874539UL; var b = 4288574029879874539UL;
c.Value = b + a; c.Value = b + a;
@ -81,10 +81,10 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalAddSignedLimb() public void FloatAddSignedLimb()
{ {
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var c = new HugeRational()) using (var c = new HugeFloat())
{ {
var b = -4288574029879874539L; var b = -4288574029879874539L;
c.Value = a + b; c.Value = a + b;
@ -94,10 +94,10 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalAddToSignedLimb() public void FloatAddToSignedLimb()
{ {
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var c = new HugeRational()) using (var c = new HugeFloat())
{ {
var b = -4288574029879874539L; var b = -4288574029879874539L;
c.Value = b + a; c.Value = b + a;
@ -107,10 +107,10 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalAddToMaxSignedLimb() public void FloatAddToMaxSignedLimb()
{ {
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var c = new HugeRational()) using (var c = new HugeFloat())
{ {
var b = long.MinValue; var b = long.MinValue;
c.Value = b + a; c.Value = b + a;
@ -120,11 +120,11 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalAddExpressionHugeRational() public void FloatAddExpressionHugeFloat()
{ {
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var b = new HugeRational("222987435987982730594288574029879874539/590872612825179551336102196593")) using (var b = new HugeFloat("222987435987982730594288574029879874539/590872612825179551336102196593"))
using (var c = new HugeRational()) using (var c = new HugeFloat())
{ {
c.Value = 1 + (a + b); c.Value = 1 + (a + b);
Assert.AreEqual(a.Numerator * b.Denominator + b.Numerator * a.Denominator + a.Denominator * b.Denominator, c.Numerator); Assert.AreEqual(a.Numerator * b.Denominator + b.Numerator * a.Denominator + a.Denominator * b.Denominator, c.Numerator);
@ -137,11 +137,11 @@ namespace MPIR.Tests.HugeRationalTests
#region Subtract #region Subtract
[TestMethod] [TestMethod]
public void RationalSubtractHugeRational() public void FloatSubtractHugeFloat()
{ {
using (var a = new HugeRational("445497268491433028939318409770173720259/115756986668303657898962467957")) using (var a = new HugeFloat("445497268491433028939318409770173720259/115756986668303657898962467957"))
using (var b = new HugeRational("222987435987982730594288574029879874539/590872612825179551336102196593")) using (var b = new HugeFloat("222987435987982730594288574029879874539/590872612825179551336102196593"))
using (var c = new HugeRational(a - b)) using (var c = new HugeFloat(a - b))
{ {
Assert.AreEqual(a.Numerator * b.Denominator - b.Numerator * a.Denominator, c.Numerator); Assert.AreEqual(a.Numerator * b.Denominator - b.Numerator * a.Denominator, c.Numerator);
Assert.AreEqual(a.Denominator * b.Denominator, c.Denominator); Assert.AreEqual(a.Denominator * b.Denominator, c.Denominator);
@ -149,11 +149,11 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalSubtractHugeInt() public void FloatSubtractHugeInt()
{ {
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var b = new HugeInt("222987435987982730594288574029879874539")) using (var b = new HugeInt("222987435987982730594288574029879874539"))
using (var c = new HugeRational(a - b)) using (var c = new HugeFloat(a - b))
{ {
Assert.AreEqual(a.Numerator - b * a.Denominator, c.Numerator); Assert.AreEqual(a.Numerator - b * a.Denominator, c.Numerator);
Assert.AreEqual(a.Denominator, c.Denominator); Assert.AreEqual(a.Denominator, c.Denominator);
@ -164,11 +164,11 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalSubtractLimb() public void FloatSubtractLimb()
{ {
var b = 4288574029879874539UL; var b = 4288574029879874539UL;
using (var a = new HugeRational("222509832503450298349318409770173720259/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298349318409770173720259/115756986668303657898962467957"))
using (var c = new HugeRational(a - b)) using (var c = new HugeFloat(a - b))
{ {
Assert.AreEqual(a.Numerator - b * a.Denominator, c.Numerator); Assert.AreEqual(a.Numerator - b * a.Denominator, c.Numerator);
Assert.AreEqual(a.Denominator, c.Denominator); Assert.AreEqual(a.Denominator, c.Denominator);
@ -176,11 +176,11 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalSubtractFromLimb() public void FloatSubtractFromLimb()
{ {
var b = 4288574029879874539UL; var b = 4288574029879874539UL;
using (var a = new HugeRational("222509832503450298349318409770173720259/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298349318409770173720259/115756986668303657898962467957"))
using (var c = new HugeRational(b - a)) using (var c = new HugeFloat(b - a))
{ {
Assert.AreEqual(b * a.Denominator - a.Numerator, c.Numerator); Assert.AreEqual(b * a.Denominator - a.Numerator, c.Numerator);
Assert.AreEqual(a.Denominator, c.Denominator); Assert.AreEqual(a.Denominator, c.Denominator);
@ -188,11 +188,11 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalSubtractPositiveSignedLimb() public void FloatSubtractPositiveSignedLimb()
{ {
var b = 4288574029879874539L; var b = 4288574029879874539L;
using (var a = new HugeRational("222509832503450298349318409770173720259/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298349318409770173720259/115756986668303657898962467957"))
using (var c = new HugeRational(a - b)) using (var c = new HugeFloat(a - b))
{ {
Assert.AreEqual(a.Numerator - b * a.Denominator, c.Numerator); Assert.AreEqual(a.Numerator - b * a.Denominator, c.Numerator);
Assert.AreEqual(a.Denominator, c.Denominator); Assert.AreEqual(a.Denominator, c.Denominator);
@ -200,11 +200,11 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalSubtractFromPositiveSignedLimb() public void FloatSubtractFromPositiveSignedLimb()
{ {
var b = 4288574029879874539L; var b = 4288574029879874539L;
using (var a = new HugeRational("222509832503450298349318409770173720259/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298349318409770173720259/115756986668303657898962467957"))
using (var c = new HugeRational(a - b)) using (var c = new HugeFloat(a - b))
{ {
Assert.AreEqual(a.Numerator - b * a.Denominator, c.Numerator); Assert.AreEqual(a.Numerator - b * a.Denominator, c.Numerator);
Assert.AreEqual(a.Denominator, c.Denominator); Assert.AreEqual(a.Denominator, c.Denominator);
@ -212,11 +212,11 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalSubtractSignedLimb() public void FloatSubtractSignedLimb()
{ {
var b = -4288574029879874539L; var b = -4288574029879874539L;
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var c = new HugeRational(a - b)) using (var c = new HugeFloat(a - b))
{ {
Assert.AreEqual(a.Numerator - b * a.Denominator, c.Numerator); Assert.AreEqual(a.Numerator - b * a.Denominator, c.Numerator);
Assert.AreEqual(a.Denominator, c.Denominator); Assert.AreEqual(a.Denominator, c.Denominator);
@ -224,11 +224,11 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalSubtractFromSignedLimb() public void FloatSubtractFromSignedLimb()
{ {
var b = -4288574029879874539L; var b = -4288574029879874539L;
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var c = new HugeRational(b - a)) using (var c = new HugeFloat(b - a))
{ {
Assert.AreEqual(b * a.Denominator - a.Numerator, c.Numerator); Assert.AreEqual(b * a.Denominator - a.Numerator, c.Numerator);
Assert.AreEqual(a.Denominator, c.Denominator); Assert.AreEqual(a.Denominator, c.Denominator);
@ -240,11 +240,11 @@ namespace MPIR.Tests.HugeRationalTests
#region Multiply #region Multiply
[TestMethod] [TestMethod]
public void RationalMultiplyByHugeRational() public void FloatMultiplyByHugeFloat()
{ {
using (var a = new HugeRational("90234098723098475098479385345098345/115756986668303657898962467957")) using (var a = new HugeFloat("90234098723098475098479385345098345/115756986668303657898962467957"))
using (var b = new HugeRational("7859487359873459872354987610987897/590872612825179551336102196593")) using (var b = new HugeFloat("7859487359873459872354987610987897/590872612825179551336102196593"))
using (var c = new HugeRational(a * b)) using (var c = new HugeFloat(a * b))
{ {
Assert.AreEqual(a.Numerator * b.Numerator, c.Numerator); Assert.AreEqual(a.Numerator * b.Numerator, c.Numerator);
Assert.AreEqual(a.Denominator * b.Denominator, c.Denominator); Assert.AreEqual(a.Denominator * b.Denominator, c.Denominator);
@ -252,11 +252,11 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalMultiplytHugeInt() public void FloatMultiplytHugeInt()
{ {
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var b = new HugeInt("222987435987982730594288574029879874539")) using (var b = new HugeInt("222987435987982730594288574029879874539"))
using (var c = new HugeRational(a * b)) using (var c = new HugeFloat(a * b))
{ {
Assert.AreEqual(a.Numerator * b, c.Numerator); Assert.AreEqual(a.Numerator * b, c.Numerator);
Assert.AreEqual(a.Denominator, c.Denominator); Assert.AreEqual(a.Denominator, c.Denominator);
@ -267,9 +267,9 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalMultiplyByLimb() public void FloatMultiplyByLimb()
{ {
using (var a = new HugeRational("90234098723098475098479385345098345/115756986668303657898962467957")) using (var a = new HugeFloat("90234098723098475098479385345098345/115756986668303657898962467957"))
{ {
ulong b = 17390538260286101342; ulong b = 17390538260286101342;
a.Value = a * b; a.Value = a * b;
@ -278,9 +278,9 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalMultiplyLimbBy() public void FloatMultiplyLimbBy()
{ {
using (var a = new HugeRational("90234098723098475098479385345098345/115756986668303657898962467957")) using (var a = new HugeFloat("90234098723098475098479385345098345/115756986668303657898962467957"))
{ {
ulong b = 17390538260286101342; ulong b = 17390538260286101342;
a.Value = b * a; a.Value = b * a;
@ -289,9 +289,9 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalMultiplyBySignedLimb() public void FloatMultiplyBySignedLimb()
{ {
using (var a = new HugeRational("90234098723098475098479385345098345/115756986668303657898962467957")) using (var a = new HugeFloat("90234098723098475098479385345098345/115756986668303657898962467957"))
{ {
long b = -7390538260286101342; long b = -7390538260286101342;
a.Value = a * b; a.Value = a * b;
@ -300,9 +300,9 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalMultiplySignedLimbBy() public void FloatMultiplySignedLimbBy()
{ {
using (var a = new HugeRational("90234098723098475098479385345098345/115756986668303657898962467957")) using (var a = new HugeFloat("90234098723098475098479385345098345/115756986668303657898962467957"))
{ {
long b = -7390538260286101342; long b = -7390538260286101342;
a.Value = b * a; a.Value = b * a;
@ -315,9 +315,9 @@ namespace MPIR.Tests.HugeRationalTests
#region Shift Left #region Shift Left
[TestMethod] [TestMethod]
public void RationalShiftLeft() public void FloatShiftLeft()
{ {
using (var a = new HugeRational("-12345700987ABCDEF2345CBDEFA245230948/17607EF654EB9A13FFA163C75", 16)) using (var a = new HugeFloat("-12345700987ABCDEF2345CBDEFA245230948/17607EF654EB9A13FFA163C75", 16))
{ {
ulong b = 40; ulong b = 40;
a.Value = a << b; a.Value = a << b;
@ -330,9 +330,9 @@ namespace MPIR.Tests.HugeRationalTests
#region Shift Right #region Shift Right
[TestMethod] [TestMethod]
public void RationalShiftRight() public void FloatShiftRight()
{ {
using (var a = new HugeRational("ABCDEF052834524092854092874502983745029345723098457209305983434345/17607EF654EB9A13FFA163C75", 16)) using (var a = new HugeFloat("ABCDEF052834524092854092874502983745029345723098457209305983434345/17607EF654EB9A13FFA163C75", 16))
{ {
ulong b = 96; ulong b = 96;
a.Value = a >> b; a.Value = a >> b;
@ -345,9 +345,9 @@ namespace MPIR.Tests.HugeRationalTests
#region Negate #region Negate
[TestMethod] [TestMethod]
public void RationalNegate() public void FloatNegate()
{ {
using (var a = new HugeRational("24092854092874502983745029345723098457209/115756986668303657898962467957")) using (var a = new HugeFloat("24092854092874502983745029345723098457209/115756986668303657898962467957"))
{ {
a.Value = -a; a.Value = -a;
Assert.AreEqual("-24092854092874502983745029345723098457209/115756986668303657898962467957", a.ToString()); Assert.AreEqual("-24092854092874502983745029345723098457209/115756986668303657898962467957", a.ToString());
@ -361,9 +361,9 @@ namespace MPIR.Tests.HugeRationalTests
#region Abs #region Abs
[TestMethod] [TestMethod]
public void RationalMakeAbsolute() public void FloatMakeAbsolute()
{ {
using (var a = new HugeRational("-24092854092874502983745029345723098457209/115756986668303657898962467957")) using (var a = new HugeFloat("-24092854092874502983745029345723098457209/115756986668303657898962467957"))
{ {
a.Value = a.Abs(); a.Value = a.Abs();
Assert.AreEqual("24092854092874502983745029345723098457209/115756986668303657898962467957", a.ToString()); Assert.AreEqual("24092854092874502983745029345723098457209/115756986668303657898962467957", a.ToString());
@ -377,9 +377,9 @@ namespace MPIR.Tests.HugeRationalTests
#region Invert #region Invert
[TestMethod] [TestMethod]
public void RationalInvert() public void FloatInvert()
{ {
using(var a = new HugeRational("-24092854092874502983745029345723098457209/115756986668303657898962467957")) using(var a = new HugeFloat("-24092854092874502983745029345723098457209/115756986668303657898962467957"))
{ {
a.Value = a.Invert(); a.Value = a.Invert();
Assert.AreEqual("-115756986668303657898962467957/24092854092874502983745029345723098457209", a.ToString()); Assert.AreEqual("-115756986668303657898962467957/24092854092874502983745029345723098457209", a.ToString());
@ -393,11 +393,11 @@ namespace MPIR.Tests.HugeRationalTests
#region Power #region Power
[TestMethod] [TestMethod]
public void RationalPower() public void FloatPower()
{ {
using(var n = new HugeInt("-24092854092874502983745029345723098457209")) using(var n = new HugeInt("-24092854092874502983745029345723098457209"))
using(var d = new HugeInt("115756986668303657898962467957")) using(var d = new HugeInt("115756986668303657898962467957"))
using(var a = new HugeRational(n, d)) using(var a = new HugeFloat(n, d))
{ {
a.Value = a ^ 5; a.Value = a ^ 5;
Assert.AreEqual(n ^ 5, a.Numerator); Assert.AreEqual(n ^ 5, a.Numerator);
@ -412,10 +412,10 @@ namespace MPIR.Tests.HugeRationalTests
#region Int #region Int
[TestMethod] [TestMethod]
public void RationalDivideHugeRational() public void FloatDivideHugeFloat()
{ {
using (var a = new HugeRational("115756986668303657898962467957/394580293847502987609283945873594873409587")) using (var a = new HugeFloat("115756986668303657898962467957/394580293847502987609283945873594873409587"))
using (var b = new HugeRational("593169091750307653294")) using (var b = new HugeFloat("593169091750307653294"))
{ {
a.Value = a / b; a.Value = a / b;
Assert.AreEqual("115756986668303657898962467957/234052834524092854092760134269509268758750275703033222451729578", a.ToString()); Assert.AreEqual("115756986668303657898962467957/234052834524092854092760134269509268758750275703033222451729578", a.ToString());
@ -423,11 +423,11 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalDivideHugeRational2() public void FloatDivideHugeFloat2()
{ {
using (var a = new HugeRational("90234098723098475098479385345098345/115756986668303657898962467957")) using (var a = new HugeFloat("90234098723098475098479385345098345/115756986668303657898962467957"))
using (var b = new HugeRational("6847944682037444681162770672798288913849/590872612825179551336102196593")) using (var b = new HugeFloat("6847944682037444681162770672798288913849/590872612825179551336102196593"))
using (var c = new HugeRational(a / b)) using (var c = new HugeFloat(a / b))
{ {
Assert.AreEqual(a.Numerator * b.Denominator, c.Numerator); Assert.AreEqual(a.Numerator * b.Denominator, c.Numerator);
Assert.AreEqual(a.Denominator * b.Numerator, c.Denominator); Assert.AreEqual(a.Denominator * b.Numerator, c.Denominator);
@ -435,12 +435,12 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalDivideHugeInt() public void FloatDivideHugeInt()
{ {
using (var a = new HugeRational("222509832503450298345029835740293845720/115756986668303657898962467957")) using (var a = new HugeFloat("222509832503450298345029835740293845720/115756986668303657898962467957"))
using (var b = new HugeInt("222987435987982730594288574029879874539")) using (var b = new HugeInt("222987435987982730594288574029879874539"))
using (var c = new HugeRational(a / b)) using (var c = new HugeFloat(a / b))
using (var d = new HugeRational()) using (var d = new HugeFloat())
{ {
Assert.AreEqual(a.Numerator, c.Numerator); Assert.AreEqual(a.Numerator, c.Numerator);
Assert.AreEqual(a.Denominator * b, c.Denominator); Assert.AreEqual(a.Denominator * b, c.Denominator);
@ -457,9 +457,9 @@ namespace MPIR.Tests.HugeRationalTests
#region Limb #region Limb
[TestMethod] [TestMethod]
public void RationalDivideLimb() public void FloatDivideLimb()
{ {
using (var a = new HugeRational("115756986668303657898962467957/39458029384750298767200622330399462537522498")) using (var a = new HugeFloat("115756986668303657898962467957/39458029384750298767200622330399462537522498"))
{ {
ulong b = 5931690917503076532; ulong b = 5931690917503076532;
a.Value = a / b; a.Value = a / b;
@ -468,9 +468,9 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalDivideSignedLimb() public void FloatDivideSignedLimb()
{ {
using(var a = new HugeRational("115756986668303657898962467957/39458029384750298767200622330399462537522498")) using(var a = new HugeFloat("115756986668303657898962467957/39458029384750298767200622330399462537522498"))
{ {
long b = -5931690917503076532; long b = -5931690917503076532;
a.Value = a / b; a.Value = a / b;
@ -479,9 +479,9 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalDivideLimbBy() public void FloatDivideLimbBy()
{ {
using(var a = new HugeRational("115756986668303657898962467957/39458029384750298767200622330399462537522498")) using(var a = new HugeFloat("115756986668303657898962467957/39458029384750298767200622330399462537522498"))
{ {
ulong b = 5931690917503076532; ulong b = 5931690917503076532;
a.Value = b / a; a.Value = b / a;
@ -490,9 +490,9 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalDivideSignedLimbBy() public void FloatDivideSignedLimbBy()
{ {
using(var a = new HugeRational("115756986668303657898962467957/39458029384750298767200622330399462537522498")) using(var a = new HugeFloat("115756986668303657898962467957/39458029384750298767200622330399462537522498"))
{ {
long b = -5931690917503076532; long b = -5931690917503076532;
a.Value = b / a; a.Value = b / a;

View File

@ -25,22 +25,22 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MPIR.Tests.HugeRationalTests namespace MPIR.Tests.HugeFloatTests
{ {
[TestClass] [TestClass]
public class ExpressionTests public class ExpressionTests
{ {
[TestMethod] [TestMethod]
public void RationalTestAllExpressions() public void FloatTestAllExpressions()
{ {
var baseExpr = typeof(RationalExpression); var baseExpr = typeof(FloatExpression);
var allExpressions = var allExpressions =
baseExpr.Assembly.GetTypes() baseExpr.Assembly.GetTypes()
.Where(x => baseExpr.IsAssignableFrom(x) && !x.IsAbstract) .Where(x => baseExpr.IsAssignableFrom(x) && !x.IsAbstract)
.ToList(); .ToList();
using (var a = new HugeRational(-9, 1)) using (var a = new HugeFloat(-9, 1))
using (var b = new HugeRational(4, 1)) using (var b = new HugeFloat(4, 1))
using (var c = new HugeInt(3)) using (var c = new HugeInt(3))
using (var r = MpirRandom.Default()) using (var r = MpirRandom.Default())
{ {
@ -68,25 +68,25 @@ namespace MPIR.Tests.HugeRationalTests
allExpressions.Select(x => Environment.NewLine + x.Name).OrderBy(x => x))); allExpressions.Select(x => Environment.NewLine + x.Name).OrderBy(x => x)));
} }
private void VerifyPartialResult(MpirRandom rnd, RationalExpression expr, long expected) private void VerifyPartialResult(MpirRandom rnd, FloatExpression expr, long expected)
{ {
rnd.Seed(123); rnd.Seed(123);
using (var r = new HugeRational()) using (var r = new HugeFloat())
{ {
r.Value = expr; r.Value = expr;
Assert.AreEqual(expected.ToString() + "/1", r.ToString()); Assert.AreEqual(expected.ToString() + "/1", r.ToString());
} }
} }
private void MarkExpressionsUsed(List<Type> allExpressions, RationalExpression expr) private void MarkExpressionsUsed(List<Type> allExpressions, FloatExpression expr)
{ {
var type = expr.GetType(); var type = expr.GetType();
allExpressions.Remove(type); allExpressions.Remove(type);
var children = type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance) var children = type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)
.Where(x => typeof(RationalExpression).IsAssignableFrom(x.FieldType)) .Where(x => typeof(FloatExpression).IsAssignableFrom(x.FieldType))
.Select(x => (RationalExpression)x.GetValue(expr)) .Select(x => (FloatExpression)x.GetValue(expr))
.Where(x => x != null) .Where(x => x != null)
.ToList(); .ToList();

View File

@ -23,16 +23,16 @@ using System.Text;
using System.Linq; using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MPIR.Tests.HugeRationalTests namespace MPIR.Tests.HugeFloatTests
{ {
[TestClass] [TestClass]
public class IO public class IO
{ {
[TestMethod] [TestMethod]
public void RationalInputOutputRaw() public void FloatInputOutputRaw()
{ {
using (var a = new HugeRational("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587")) using (var a = new HugeFloat("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587"))
using (var b = new HugeRational()) using (var b = new HugeFloat())
using (var ms = new MemoryStream()) using (var ms = new MemoryStream())
{ {
a.Value = a ^ 100; a.Value = a ^ 100;
@ -45,10 +45,10 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalInputOutputStr() public void FloatInputOutputStr()
{ {
using (var a = new HugeRational("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587")) using (var a = new HugeFloat("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587"))
using (var b = new HugeRational()) using (var b = new HugeFloat())
using (var ms = new MemoryStream()) using (var ms = new MemoryStream())
{ {
a.Value = a ^ 100; a.Value = a ^ 100;
@ -66,10 +66,10 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalInputOutputStrHex() public void FloatInputOutputStrHex()
{ {
using (var a = new HugeRational("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587")) using (var a = new HugeFloat("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587"))
using (var b = new HugeRational()) using (var b = new HugeFloat())
using (var ms = new MemoryStream()) using (var ms = new MemoryStream())
{ {
a.Value = a ^ 100; a.Value = a ^ 100;
@ -88,10 +88,10 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalInputOutputStrHexPrefix() public void FloatInputOutputStrHexPrefix()
{ {
using (var a = new HugeRational("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587")) using (var a = new HugeFloat("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587"))
using (var b = new HugeRational()) using (var b = new HugeFloat())
using (var ms = new MemoryStream()) using (var ms = new MemoryStream())
{ {
a.Value = a ^ 100; a.Value = a ^ 100;
@ -114,10 +114,10 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalInputOutputStrHexLower() public void FloatInputOutputStrHexLower()
{ {
using (var a = new HugeRational("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587")) using (var a = new HugeFloat("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587"))
using (var b = new HugeRational()) using (var b = new HugeFloat())
using (var ms = new MemoryStream()) using (var ms = new MemoryStream())
{ {
a.Value = a ^ 100; a.Value = a ^ 100;
@ -135,10 +135,10 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalInputOutputStrOctal() public void FloatInputOutputStrOctal()
{ {
using (var a = new HugeRational("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587")) using (var a = new HugeFloat("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587"))
using (var b = new HugeRational()) using (var b = new HugeFloat())
using (var ms = new MemoryStream()) using (var ms = new MemoryStream())
{ {
a.Value = a ^ 100; a.Value = a ^ 100;
@ -157,10 +157,10 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalInputOutputStrBinary() public void FloatInputOutputStrBinary()
{ {
using (var a = new HugeRational("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587")) using (var a = new HugeFloat("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587"))
using (var b = new HugeRational()) using (var b = new HugeFloat())
using (var ms = new MemoryStream()) using (var ms = new MemoryStream())
{ {
a.Value = a ^ 100; a.Value = a ^ 100;
@ -179,10 +179,10 @@ namespace MPIR.Tests.HugeRationalTests
} }
[TestMethod] [TestMethod]
public void RationalInputOutputStr62() public void FloatInputOutputStr62()
{ {
using (var a = new HugeRational("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587")) using (var a = new HugeFloat("0x10123456789ABCDEF0123456789ABCDEF0123456789ABCDEF/361720912810755408215708460645842859722715865206816237944587"))
using (var b = new HugeRational()) using (var b = new HugeFloat())
using (var ms = new MemoryStream()) using (var ms = new MemoryStream())
{ {
a.Value = a ^ 100; a.Value = a ^ 100;