Skip to content

Commit 6ffa8b1

Browse files
authored
🐛Fix precision of Volume.CubicInch (#1358)
Fixes #1357 An imprecise value was used, fixed by using the definition of inch as 2.54e-2 per meter. Verified that the related unit CubicFoot is already precise.
1 parent 70a6a2b commit 6ffa8b1

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Common/UnitDefinitions/Volume.json

Lines changed: 2 additions & 2 deletions
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.6387064e-5",
198+
"FromBaseToUnitFunc": "{x} / 1.6387064e-5",
199199
"Localization": [
200200
{
201201
"Culture": "en-US",

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

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.Tests/CustomCode/VolumeTests.cs

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)