File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,9 @@ namespace UnitsNet
28
28
/// </summary>
29
29
public struct Length : IComparable , IComparable < Length >
30
30
{
31
- private const double MilsToMetersRatio = 2.54E-5 ;
32
31
public readonly double Meters ;
32
+ private const double MilsToMetersRatio = 2.54E-5 ;
33
+ private const double MicroInchToMeterRatio = 2.54E-8 ;
33
34
34
35
/// <summary>
35
36
/// Enforce static methods for creation.
@@ -93,7 +94,7 @@ public double Nanometers
93
94
94
95
public double Microinch
95
96
{
96
- get { return Meters * 39370078.7 ; }
97
+ get { return Meters / MicroInchToMeterRatio ; }
97
98
}
98
99
99
100
public double Mil
@@ -183,7 +184,7 @@ public static Length FromNanometers(double nm)
183
184
184
185
public static Length FromMicroinches ( double mi )
185
186
{
186
- return FromMeters ( mi / 39370078.7 ) ;
187
+ return FromMeters ( mi * MicroInchToMeterRatio ) ;
187
188
}
188
189
189
190
public static Length FromMils ( double mils )
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public void MetersToDistanceUnits()
25
25
Assert . AreEqual ( 1.09361 , meter . Yards , Delta ) ;
26
26
Assert . AreEqual ( 3.28084 , meter . Feet , Delta ) ;
27
27
Assert . AreEqual ( 39.3701 , meter . Inches , Delta ) ;
28
- Assert . AreEqual ( 39370078.7 , meter . Microinch , Delta ) ;
28
+ Assert . AreEqual ( 39370078.74015748 , meter . Microinch , Delta ) ;
29
29
Assert . AreEqual ( 39370.07874015 , meter . Mil , Delta ) ;
30
30
}
31
31
You can’t perform that action at this time.
0 commit comments