Skip to content

Commit

Permalink
Basic use update.
Browse files Browse the repository at this point in the history
  • Loading branch information
KUTlime committed Jul 9, 2019
1 parent 23247c2 commit 8585ad2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ var celsius2 = new Celsius(new Kelvin(Constants.MeltingPointH2OInKelvin)); // ..
var kelvin = new Kelvin(Constants.MeltingPointH2OInKelvin); // Same applies to other unit ctors...
var delisle = new Delisle("100 °Ré");


// Double value extraction from units
double celsiusAsDouble = celsius.Value; // Use Value property.

// Arithmetics(T2 = T1 +/- ΔT)
var celsius3 = celsius + celsius1; // Same unit...
var celsius4 = celsius + kelvin; // ...or any unit with any another unit.
Expand All @@ -45,21 +47,26 @@ celsius4.Value = 30; // Direct manipulation with temperature value.
celsius3 += celsius4; // Compound operators are also provided...
celsius3 -= celsius4; // ... same for subtraction.
// Double-to-double conversion

// Double-to-double conversion (28 different methods are provided)
double valueInFahrenheit = Converter.Ran2Fah(Constants.BoilingPointH2OInRankine);


// OOP Conversion
var fahrenheit = celsius.ToFahrenheit(); // From an instance.
var newton = Celsius.ToNewton(fahrenheit); // Static conversion.

// Extraction of converted temperature as double
var delisle = new Delisle().
double value = delisle.Value; // Absolute zero in Delisle is returned.

// Static conversion from a Rømer value as double to a Celsius instance and double extraction
var rømer = new Rømer();
double cel = Rømer.ToCelsius(rømer.Value).Value;


// Comparison
celsius3.Value = 20;
celsius4.Value = 20;
Expand All @@ -77,6 +84,7 @@ if (celsius == kelvin)
// ...
}


// Test for correctness when Value property is updated
celsius.Value = -500; // Throws an exception.
Expand Down

0 comments on commit 8585ad2

Please sign in to comment.