MolecularWeightCalculator 1.0.2
See the version list below for details.
dotnet add package MolecularWeightCalculator --version 1.0.2
NuGet\Install-Package MolecularWeightCalculator -Version 1.0.2
<PackageReference Include="MolecularWeightCalculator" Version="1.0.2" />
paket add MolecularWeightCalculator --version 1.0.2
#r "nuget: MolecularWeightCalculator, 1.0.2"
// Install MolecularWeightCalculator as a Cake Addin #addin nuget:?package=MolecularWeightCalculator&version=1.0.2 // Install MolecularWeightCalculator as a Cake Tool #tool nuget:?package=MolecularWeightCalculator&version=1.0.2
Molecular Mass Weight Calculator
This is a C# library for calculating the molecular mass of chemical compounds. It allows you to input a chemical formula and computes the total molecular weight by summing up the atomic weights of the constituent elements.
Features
- Calculate the molecular weight of chemical compounds.
- Support for standard atomic weights of elements.
- Simple and intuitive DLL for integration into your projects.
Installation
You can install the Molecular Mass Calculator library via NuGet Package Manager Console:
Install-Package MolecularMassCalculator
Usage
Here's how you can use the library to calculate the molecular weight of a chemical compound:
var molecularMath = new MolecularMath();
string exp1 = "CO2";
var exp1Result = molecularMath.ComputeMass(exp1);
Console.WriteLine($"{exp1}=>{exp1Result}");
//CO2=>44.0095
string exp2 = "CaCO3";
var exp2Result = molecularMath.ComputeMass(exp2);
Console.WriteLine($"{exp2}=>{exp2Result}");
//CaCO3=>100.0869
string exp3 = "CO2 / CaCO3";
var exp3Result = molecularMath.ComputeMass(exp3);
Console.WriteLine($"{exp3}=>{exp3Result}");
//CO2 / CaCO3=>0.43971288949902537
string exp4 = "C2H2 +2.5 * O2";
var exp4Result = molecularMath.ComputeMass(exp4);
Console.WriteLine($"{exp4}=>{exp4Result}");
//C2H2 +2.5 * O2=>106.03428
string exp5 = "2*CO2/C2H2";
var exp5Result = molecularMath.ComputeMass(exp5);
Console.WriteLine($"{exp5}=>{exp5Result}");
//2*CO2/C2H2=>3.380499038302004
string exp6 = "1*2*3*4";
var exp6Result = molecularMath.ComputeMass(exp6);
Console.WriteLine($"{exp6}=>{exp6Result}");
//1*2*3*4=>24
string exp7 = "CaCO3 * A2 + B3";
//var exp7Result = molecularMath.ComputeMass(exp7);
//Console.WriteLine($"{exp7}=>{exp7Result}");
//KeyNotFoundException: 'A' was not present in the Periodic Table
ChangeLog
Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- ncalc (>= 1.3.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
## 1.0.2
### Bug Fixes
* change ComputeMass method return type from double to object