ktsu.Semantics.Quantities.Float
5.4.2
Prefix Reserved
dotnet add package ktsu.Semantics.Quantities.Float --version 5.4.2
NuGet\Install-Package ktsu.Semantics.Quantities.Float -Version 5.4.2
<PackageReference Include="ktsu.Semantics.Quantities.Float" Version="5.4.2" />
<PackageVersion Include="ktsu.Semantics.Quantities.Float" Version="5.4.2" />
<PackageReference Include="ktsu.Semantics.Quantities.Float" />
paket add ktsu.Semantics.Quantities.Float --version 5.4.2
#r "nuget: ktsu.Semantics.Quantities.Float, 5.4.2"
#:package ktsu.Semantics.Quantities.Float@5.4.2
#addin nuget:?package=ktsu.Semantics.Quantities.Float&version=5.4.2
#tool nuget:?package=ktsu.Semantics.Quantities.Float&version=5.4.2
ktsu.Semantics.Quantities.Float
Storage-type aliases that bind every
ktsu.Semantics.Quantitiestype tofloat, so you writeMassinstead ofMass<float>, project-wide.
ktsu.Semantics.Quantities.Float is a satellite of ktsu.Semantics.Quantities in the ktsu.Semantics family. Read the core package README first for the quantity API itself.
Introduction
Every quantity in ktsu.Semantics.Quantities is generic over its numeric storage type, so you normally write Mass<float>, Speed<float>, and so on. If a project uses one storage type throughout, that generic argument is noise.
This package is props-only. It ships no assembly, just a buildTransitive props file that injects one C# global-using alias per quantity, binding each open generic type to float. Reference it and you can write Mass, Speed, Force3D with no generic argument, and every quantity resolves to its float form. The aliases are real Mass<float> (and so on), so they interoperate with the entire API with no conversion.
Installing this package also pulls in the matching version of ktsu.Semantics.Quantities as a dependency, so it is the only reference you need.
Installation
Package Manager Console
Install-Package ktsu.Semantics.Quantities.Float
.NET CLI
dotnet add package ktsu.Semantics.Quantities.Float
Package Reference
<PackageReference Include="ktsu.Semantics.Quantities.Float" Version="x.y.z" />
Usage Example
using ktsu.Semantics.Quantities; // types resolve to their float form via the injected aliases
Mass mass = Mass.FromKilogram(10.0f);
Speed speed = Speed.FromMeterPerSecond(15.0f);
Mass total = mass + Mass.FromKilogram(2.0f); // still a Mass<float>, full identity
Force3D f = new() { X = 3.0f, Y = 4.0f, Z = 0.0f };
ForceMagnitude mag = f.Magnitude(); // 5.0
Under the hood the injected alias looks like this (one line per quantity, roughly 220 in total):
<Using Include="ktsu.Semantics.Quantities.Mass<float>" Alias="Mass" />
Use exactly one storage-type alias package per project
The aliases are project-wide global usings keyed on the bare type name (Mass, Speed, ...). Referencing two flavor packages in the same project would define the same alias name twice (one bound to float, one to another type), which is a compile error. So reference exactly one of:
ktsu.Semantics.Quantities.Doublektsu.Semantics.Quantities.Float(this package)ktsu.Semantics.Quantities.Decimalktsu.Semantics.Quantities.Precise
A project that genuinely needs mixed storage types should skip the alias packages and reference ktsu.Semantics.Quantities directly, writing the closed generic (Mass<float>) explicitly.
The alias lists are generated from the quantity catalogue by scripts/Generate-AliasProps.ps1 and validated in CI, so they stay in lockstep with the quantities the core package emits.
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
License
This project is licensed under the MIT License. See the LICENSE.md file for details.
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- ktsu.Semantics.Quantities (>= 5.4.2)
-
net8.0
- ktsu.Semantics.Quantities (>= 5.4.2)
-
net9.0
- ktsu.Semantics.Quantities (>= 5.4.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.4.2 | 35 | 9/18/2026 |
| 5.4.1 | 62 | 9/17/2026 |
| 5.4.0 | 51 | 9/17/2026 |
| 5.3.4 | 96 | 9/16/2026 |
| 5.3.3 | 81 | 9/16/2026 |
| 5.3.2 | 70 | 9/16/2026 |
| 5.3.1 | 101 | 9/15/2026 |
| 5.3.0 | 104 | 9/14/2026 |
| 5.2.4 | 94 | 9/14/2026 |
| 5.2.3 | 97 | 9/14/2026 |
| 5.2.2 | 91 | 9/14/2026 |
| 5.2.1 | 93 | 9/13/2026 |
| 5.2.0 | 100 | 9/13/2026 |
| 5.1.0 | 96 | 9/13/2026 |
| 5.0.1 | 105 | 9/13/2026 |
| 5.0.0 | 108 | 9/12/2026 |
| 4.3.2 | 100 | 9/12/2026 |
| 4.3.1 | 93 | 9/12/2026 |
| 4.3.0 | 93 | 9/12/2026 |
| 4.2.0 | 102 | 9/11/2026 |
## v5.4.2 (patch)
Changes since v5.4.1:
- Merge main into the strings and paths benchmark work ([@matt-edmondson](https://github.com/matt-edmondson))
- Fix whole-branch review findings in benchmark docs [patch] ([@matt-edmondson](https://github.com/matt-edmondson))
- Fix review findings: bullet count and heading nesting ([@matt-edmondson](https://github.com/matt-edmondson))
- Document the strings and paths benchmarks [patch] ([@matt-edmondson](https://github.com/matt-edmondson))
- Backfill the strings and paths histories ([@matt-edmondson](https://github.com/matt-edmondson))
- Seed the strings and paths histories at 5.3.4 ([@matt-edmondson](https://github.com/matt-edmondson))
- Record what the validation ladder actually measured ([@matt-edmondson](https://github.com/matt-edmondson))
- Redirect stdin from /dev/null in the subject loops ([@matt-edmondson](https://github.com/matt-edmondson))
- Measure three subjects per run ([@matt-edmondson](https://github.com/matt-edmondson))
- Fix strings XML doc to describe HashCode, not CompareTo ([@matt-edmondson](https://github.com/matt-edmondson))
- Describe the panel the strings chart actually draws ([@matt-edmondson](https://github.com/matt-edmondson))
- Explain the Create ratio's outlier size in the source, not just the report ([@matt-edmondson](https://github.com/matt-edmondson))
- Draw the strings and paths charts ([@matt-edmondson](https://github.com/matt-edmondson))
- Pair the path types against System.IO.Path ([@matt-edmondson](https://github.com/matt-edmondson))
- Declare the relative path specimen as a const ([@matt-edmondson](https://github.com/matt-edmondson))
- Make RelativeFile a const, not a suppressed readonly field ([@matt-edmondson](https://github.com/matt-edmondson))
- Measure the path types, building and operating ([@matt-edmondson](https://github.com/matt-edmondson))
- Fix Ordering baseline to match the culture-sensitive comparison it pairs against ([@matt-edmondson](https://github.com/matt-edmondson))
- Compare like with like in the string ordering pair ([@matt-edmondson](https://github.com/matt-edmondson))
- Pair the string types against hand-written validation ([@matt-edmondson](https://github.com/matt-edmondson))
- Chart GetHashCode rather than CompareTo for strings ([@matt-edmondson](https://github.com/matt-edmondson))
- Measure a semantic string after it exists ([@matt-edmondson](https://github.com/matt-edmondson))
- Correct the expected cost of the two string failure paths ([@matt-edmondson](https://github.com/matt-edmondson))
- Measure creating a semantic string across the validation ladder ([@matt-edmondson](https://github.com/matt-edmondson))
- Make the release chart renderer subject-aware ([@matt-edmondson](https://github.com/matt-edmondson))
- Plan the strings and paths benchmark work ([@matt-edmondson](https://github.com/matt-edmondson))
- Design the benchmark history and charts for strings and paths ([@matt-edmondson](https://github.com/matt-edmondson))