Skip to content

Commit b545de2

Browse files
committed
🐛Fix precision of Volume.CubicInch
Fixes #1357 An imprecise value was used, fixed by using the definition of inch as 2.54e-2 per meter.
1 parent 70a6a2b commit b545de2

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Common/UnitDefinitions/Volume.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@
194194
{
195195
"SingularName": "CubicInch",
196196
"PluralName": "CubicInches",
197-
"FromUnitToBaseFunc": "{x} * 1.6387 * 1e-5",
198-
"FromBaseToUnitFunc": "{x} / (1.6387 * 1e-5)",
197+
"FromUnitToBaseFunc": "{x} * 1.6387064-5",
198+
"FromBaseToUnitFunc": "{x} / 1.6387064-5",
199199
"Localization": [
200200
{
201201
"Culture": "en-US",

UnitsNet.NanoFramework/GeneratedCode/Quantities/Volume.g.cs

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.Tests/CustomCode/VolumeTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class VolumeTests : VolumeTestsBase
1717

1818
protected override double CubicFeetInOneCubicMeter => 35.314666721488590250438010354003;
1919

20-
protected override double CubicInchesInOneCubicMeter => 61023.98242;
20+
protected override double CubicInchesInOneCubicMeter => 61_023.744094732283952756881891717;
2121

2222
protected override double CubicKilometersInOneCubicMeter => 1E-9;
2323

UnitsNet/GeneratedCode/Quantities/Volume.g.cs

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)