Skip to content

Commit

Permalink
🐛Fix precision of Volume.CubicInch (angularsen#1358)
Browse files Browse the repository at this point in the history
Fixes angularsen#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.
  • Loading branch information
angularsen committed Jan 23, 2024
1 parent 70a6a2b commit 6ffa8b1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Common/UnitDefinitions/Volume.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@
{
"SingularName": "CubicInch",
"PluralName": "CubicInches",
"FromUnitToBaseFunc": "{x} * 1.6387 * 1e-5",
"FromBaseToUnitFunc": "{x} / (1.6387 * 1e-5)",
"FromUnitToBaseFunc": "{x} * 1.6387064e-5",
"FromBaseToUnitFunc": "{x} / 1.6387064e-5",
"Localization": [
{
"Culture": "en-US",
Expand Down
4 changes: 2 additions & 2 deletions UnitsNet.NanoFramework/GeneratedCode/Quantities/Volume.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion UnitsNet.Tests/CustomCode/VolumeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class VolumeTests : VolumeTestsBase

protected override double CubicFeetInOneCubicMeter => 35.314666721488590250438010354003;

protected override double CubicInchesInOneCubicMeter => 61023.98242;
protected override double CubicInchesInOneCubicMeter => 61_023.744094732283952756881891717;

protected override double CubicKilometersInOneCubicMeter => 1E-9;

Expand Down
4 changes: 2 additions & 2 deletions UnitsNet/GeneratedCode/Quantities/Volume.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6ffa8b1

Please sign in to comment.