Make Display size float rounding equal in all properties and formats

This commit is contained in:
Tiago Conceição
2023-01-06 18:08:57 +00:00
parent 9b6416241a
commit 8a0ba6719e
23 changed files with 120 additions and 184 deletions
+3 -2
View File
@@ -13,10 +13,11 @@ namespace UVtools.Core.Extensions;
public static class SpanExtensions
{
public static unsafe void Fill<T>(this Span<T> span, Func<T> provider) where T : struct
public static unsafe void Fill<T>(this Span<T> span, Func<T> provider, int cores = -1) where T : struct
{
if (cores <= 0) cores = Environment.ProcessorCount;
int
cores = Environment.ProcessorCount,
batch = span.Length / cores,
mod = span.Length % cores,
size = Unsafe.SizeOf<T>();