From 4c0a5890bcf04152b99d0d80ff9cee15464bed1b Mon Sep 17 00:00:00 2001 From: melekhin Date: Wed, 10 Jun 2026 16:44:55 +0700 Subject: [PATCH] Pow Sqrt .... --- QWERTYkez.Mensura.Generator/TestsGenerator.cs | 17 +- .../Extensions/DoubleExtensions.cs | 302 +++++++++--------- QWERTYkez.Mensura/Units/Area.cs | 21 ++ QWERTYkez.Mensura/Units/Length.cs | 46 +++ QWERTYkez.Mensura/Units/Voltage.cs | 23 ++ 5 files changed, 249 insertions(+), 160 deletions(-) diff --git a/QWERTYkez.Mensura.Generator/TestsGenerator.cs b/QWERTYkez.Mensura.Generator/TestsGenerator.cs index 21842e1..c2d3bce 100644 --- a/QWERTYkez.Mensura.Generator/TestsGenerator.cs +++ b/QWERTYkez.Mensura.Generator/TestsGenerator.cs @@ -111,17 +111,16 @@ public class TestsGenerator : IIncrementalGenerator var pars = method.Parameters; if (pars.Length != 2) continue; - var leftType = pars[0].Type as INamedTypeSymbol; - var rightType = pars[1].Type as INamedTypeSymbol; - var returnType = method.ReturnType as INamedTypeSymbol; - if (leftType == null || rightType == null || returnType == null) continue; + if (pars[0].Type is not INamedTypeSymbol leftType + || pars[1].Type is not INamedTypeSymbol rightType + || method.ReturnType is not INamedTypeSymbol returnType) continue; if (!unitTypes.Contains(leftType, SymbolEqualityComparer.Default) || !unitTypes.Contains(rightType, SymbolEqualityComparer.Default) || !unitTypes.Contains(returnType, SymbolEqualityComparer.Default)) continue; - string? coeffField = null; + string coeffField = null; foreach (var attr in method.GetAttributes()) { if (attr.AttributeClass?.Name == "OperatorsGeneratorAttribute" || @@ -142,7 +141,7 @@ public class TestsGenerator : IIncrementalGenerator result.Add(new OperatorInfo(opSymbol, leftType, rightType, returnType, coeffField, containingType)); } } - return result.ToImmutableArray(); + return [.. result]; } private static void GenerateOperatorTests(SourceProductionContext spc, ImmutableArray operators) @@ -397,7 +396,7 @@ public class TestsGenerator : IIncrementalGenerator CollectTypesRecursive(childNs, result, targetNamespacePrefix); } - private static IPropertySymbol? GetBaseUnitProperty(ITypeSymbol type) + private static IPropertySymbol GetBaseUnitProperty(ITypeSymbol type) { foreach (var member in type.GetMembers()) { @@ -407,13 +406,13 @@ public class TestsGenerator : IIncrementalGenerator return null; } - private readonly struct OperatorInfo(string symbol, ITypeSymbol left, ITypeSymbol right, ITypeSymbol ret, string? coeff, ITypeSymbol containing) + private readonly struct OperatorInfo(string symbol, ITypeSymbol left, ITypeSymbol right, ITypeSymbol ret, string coeff, ITypeSymbol containing) { public string OperatorSymbol { get; } = symbol; public ITypeSymbol LeftType { get; } = left; public ITypeSymbol RightType { get; } = right; public ITypeSymbol ReturnType { get; } = ret; - public string? CoefficientField { get; } = coeff; + public string CoefficientField { get; } = coeff; public ITypeSymbol ContainingType { get; } = containing; } } \ No newline at end of file diff --git a/QWERTYkez.Mensura/Extensions/DoubleExtensions.cs b/QWERTYkez.Mensura/Extensions/DoubleExtensions.cs index ee127c1..8aa833b 100644 --- a/QWERTYkez.Mensura/Extensions/DoubleExtensions.cs +++ b/QWERTYkez.Mensura/Extensions/DoubleExtensions.cs @@ -1,6 +1,6 @@ namespace QWERTYkez.Mensura.Extensions; -public static partial class DoubleExtensions +internal static partial class DoubleExtensions { internal static double ToDouble(this byte number) => Convert.ToDouble(number); internal static double ToDouble(this sbyte number) => Convert.ToDouble(number); @@ -443,7 +443,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this byte[] numbers) + internal static double[] ToDouble(this byte[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -453,7 +453,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -463,7 +463,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -482,7 +482,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -501,7 +501,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is byte[] array) return array.ToDouble(); @@ -526,7 +526,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this sbyte[] numbers) + internal static double[] ToDouble(this sbyte[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -536,7 +536,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -546,7 +546,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -565,7 +565,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -584,7 +584,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is sbyte[] array) return array.ToDouble(); @@ -609,7 +609,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this short[] numbers) + internal static double[] ToDouble(this short[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -619,7 +619,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -629,7 +629,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -648,7 +648,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -667,7 +667,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is short[] array) return array.ToDouble(); @@ -692,7 +692,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this ushort[] numbers) + internal static double[] ToDouble(this ushort[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -702,7 +702,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -712,7 +712,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -731,7 +731,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -750,7 +750,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is ushort[] array) return array.ToDouble(); @@ -775,7 +775,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this int[] numbers) + internal static double[] ToDouble(this int[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -785,7 +785,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -795,7 +795,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -814,7 +814,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -833,7 +833,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is int[] array) return array.ToDouble(); @@ -858,7 +858,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this uint[] numbers) + internal static double[] ToDouble(this uint[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -868,7 +868,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -878,7 +878,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -897,7 +897,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -916,7 +916,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is uint[] array) return array.ToDouble(); @@ -941,7 +941,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this nint[] numbers) + internal static double[] ToDouble(this nint[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -951,7 +951,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -961,7 +961,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -980,7 +980,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -999,7 +999,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is nint[] array) return array.ToDouble(); @@ -1024,7 +1024,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this nuint[] numbers) + internal static double[] ToDouble(this nuint[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -1034,7 +1034,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -1044,7 +1044,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1063,7 +1063,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1082,7 +1082,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is nuint[] array) return array.ToDouble(); @@ -1107,7 +1107,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this long[] numbers) + internal static double[] ToDouble(this long[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -1117,7 +1117,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -1127,7 +1127,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1146,7 +1146,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1165,7 +1165,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is long[] array) return array.ToDouble(); @@ -1190,7 +1190,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this ulong[] numbers) + internal static double[] ToDouble(this ulong[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -1200,7 +1200,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -1210,7 +1210,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1229,7 +1229,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1248,7 +1248,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is ulong[] array) return array.ToDouble(); @@ -1273,7 +1273,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this Half[] numbers) + internal static double[] ToDouble(this Half[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -1283,7 +1283,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -1293,7 +1293,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1312,7 +1312,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1331,7 +1331,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is Half[] array) return array.ToDouble(); @@ -1356,7 +1356,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this float[] numbers) + internal static double[] ToDouble(this float[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -1366,7 +1366,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -1376,7 +1376,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1395,7 +1395,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1414,7 +1414,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is float[] array) return array.ToDouble(); @@ -1439,7 +1439,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this decimal[] numbers) + internal static double[] ToDouble(this decimal[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -1449,7 +1449,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -1459,7 +1459,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1478,7 +1478,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1497,7 +1497,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is decimal[] array) return array.ToDouble(); @@ -1523,7 +1523,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this Int128[] numbers) + internal static double[] ToDouble(this Int128[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -1533,7 +1533,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -1543,7 +1543,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1562,7 +1562,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1581,7 +1581,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is Int128[] array) return array.ToDouble(); @@ -1606,7 +1606,7 @@ public static partial class DoubleExtensions } return destination; } - public static double[] ToDouble(this UInt128[] numbers) + internal static double[] ToDouble(this UInt128[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -1616,7 +1616,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -1626,7 +1626,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1645,7 +1645,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -1664,7 +1664,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is UInt128[] array) return array.ToDouble(); @@ -2026,7 +2026,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this byte?[] numbers) + internal static double?[] ToDouble(this byte?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -2036,7 +2036,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -2046,7 +2046,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2065,7 +2065,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2084,7 +2084,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is byte?[] array) return array.ToDouble(); @@ -2109,7 +2109,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this sbyte?[] numbers) + internal static double?[] ToDouble(this sbyte?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -2119,7 +2119,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -2129,7 +2129,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2148,7 +2148,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2167,7 +2167,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is sbyte?[] array) return array.ToDouble(); @@ -2192,7 +2192,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this short?[] numbers) + internal static double?[] ToDouble(this short?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -2202,7 +2202,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -2212,7 +2212,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2231,7 +2231,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2250,7 +2250,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is short?[] array) return array.ToDouble(); @@ -2275,7 +2275,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this ushort?[] numbers) + internal static double?[] ToDouble(this ushort?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -2285,7 +2285,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -2295,7 +2295,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2314,7 +2314,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2333,7 +2333,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is ushort?[] array) return array.ToDouble(); @@ -2358,7 +2358,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this int?[] numbers) + internal static double?[] ToDouble(this int?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -2368,7 +2368,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -2378,7 +2378,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2397,7 +2397,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2416,7 +2416,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is int?[] array) return array.ToDouble(); @@ -2441,7 +2441,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this uint?[] numbers) + internal static double?[] ToDouble(this uint?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -2451,7 +2451,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -2461,7 +2461,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2480,7 +2480,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2499,7 +2499,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is uint?[] array) return array.ToDouble(); @@ -2524,7 +2524,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this nint?[] numbers) + internal static double?[] ToDouble(this nint?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -2534,7 +2534,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -2544,7 +2544,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2563,7 +2563,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2582,7 +2582,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is nint?[] array) return array.ToDouble(); @@ -2607,7 +2607,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this nuint?[] numbers) + internal static double?[] ToDouble(this nuint?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -2617,7 +2617,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -2627,7 +2627,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2646,7 +2646,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2665,7 +2665,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is nuint?[] array) return array.ToDouble(); @@ -2690,7 +2690,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this long?[] numbers) + internal static double?[] ToDouble(this long?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -2700,7 +2700,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -2710,7 +2710,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2729,7 +2729,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2748,7 +2748,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is long?[] array) return array.ToDouble(); @@ -2773,7 +2773,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this ulong?[] numbers) + internal static double?[] ToDouble(this ulong?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -2783,7 +2783,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -2793,7 +2793,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2812,7 +2812,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2831,7 +2831,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is ulong?[] array) return array.ToDouble(); @@ -2856,7 +2856,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this Half?[] numbers) + internal static double?[] ToDouble(this Half?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -2866,7 +2866,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -2876,7 +2876,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2895,7 +2895,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2914,7 +2914,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is Half?[] array) return array.ToDouble(); @@ -2939,7 +2939,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this float?[] numbers) + internal static double?[] ToDouble(this float?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -2949,7 +2949,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -2959,7 +2959,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2978,7 +2978,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -2997,7 +2997,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is float?[] array) return array.ToDouble(); @@ -3022,7 +3022,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this decimal?[] numbers) + internal static double?[] ToDouble(this decimal?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -3032,7 +3032,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -3042,7 +3042,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -3061,7 +3061,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -3080,7 +3080,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is decimal?[] array) return array.ToDouble(); @@ -3106,7 +3106,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this Int128?[] numbers) + internal static double?[] ToDouble(this Int128?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -3116,7 +3116,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -3126,7 +3126,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -3145,7 +3145,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -3164,7 +3164,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is Int128?[] array) return array.ToDouble(); @@ -3189,7 +3189,7 @@ public static partial class DoubleExtensions } return destination; } - public static double?[] ToDouble(this UInt128?[] numbers) + internal static double?[] ToDouble(this UInt128?[] numbers) { if (numbers is null) return null!; int len = numbers.Length; @@ -3199,7 +3199,7 @@ public static partial class DoubleExtensions numbers.ToDoubleCore(len, result); return result; } - public static List ToDouble(this List numbers) + internal static List ToDouble(this List numbers) { if (numbers is null) return null!; int len = numbers.Count; @@ -3209,7 +3209,7 @@ public static partial class DoubleExtensions CollectionsMarshal.AsSpan(numbers).ToDoubleCore(len, result); return result.WrapAsList(); } - public static void ToDouble(this ICollection numbers, Span destination) + internal static void ToDouble(this ICollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -3228,7 +3228,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static void ToDouble(this IReadOnlyCollection numbers, Span destination) + internal static void ToDouble(this IReadOnlyCollection numbers, Span destination) { if (numbers is null) return; int count = numbers.Count; @@ -3247,7 +3247,7 @@ public static partial class DoubleExtensions Unsafe.Add(ref dstRef, i++) = (double?)item; } } - public static IEnumerable ToDouble(this IEnumerable numbers) + internal static IEnumerable ToDouble(this IEnumerable numbers) { if (numbers is null) return null!; if (numbers is UInt128?[] array) return array.ToDouble(); diff --git a/QWERTYkez.Mensura/Units/Area.cs b/QWERTYkez.Mensura/Units/Area.cs index eb99e44..deed4bd 100644 --- a/QWERTYkez.Mensura/Units/Area.cs +++ b/QWERTYkez.Mensura/Units/Area.cs @@ -57,6 +57,27 @@ public readonly partial record struct Area public Area AddKiloMetersSquared(double value) => new(_Value + AreaConv.KiloMetersSquared.To(value)); } +public static class AreaSqrtExtension +{ + // === ReadOnlySpan + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Sqrt( + this ReadOnlySpan units, Span destination) => units.Sqrt(destination); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Sqrt( + this ReadOnlySpan units, Span destination) => units.Sqrt(destination); + + // === Array === + [MethodImpl(MethodImplOptions.AggressiveInlining)]public static Length[] Sqrt(this Area[] units) => units.Sqrt(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Length?[] Sqrt(this Area?[] units) => units.Sqrt(); + + // === List === + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static List Sqrt(this List units) => units.Sqrt(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static List Sqrt(this List units) => units.Sqrt(); + + // === IEnumerable === + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IEnumerable Sqrt(this IEnumerable units) => units.Sqrt(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IEnumerable Sqrt(this IEnumerable units) => units.Sqrt(); +} + internal readonly struct AreaConv { private AreaConv(double multiplicator) => this.Multiplicator = multiplicator; diff --git a/QWERTYkez.Mensura/Units/Length.cs b/QWERTYkez.Mensura/Units/Length.cs index 54ed93f..2582d7f 100644 --- a/QWERTYkez.Mensura/Units/Length.cs +++ b/QWERTYkez.Mensura/Units/Length.cs @@ -83,6 +83,52 @@ public readonly partial record struct Length } } +public static class LengthPowExtension +{ + // === ReadOnlySpan + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Pow( + this ReadOnlySpan units, Span destination) => units.Pow(destination); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Pow( + this ReadOnlySpan units, Span destination) => units.Pow(destination); + + // === Array === + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Area[] Pow(this Length[] units) => units.Pow(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Area?[] Pow(this Length?[] units) => units.Pow(); + + // === List === + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static List Pow(this List units) => units.Pow(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static List Pow(this List units) => units.Pow(); + + // === IEnumerable === + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IEnumerable Pow(this IEnumerable units) => units.Pow(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IEnumerable Pow(this IEnumerable units) => units.Pow(); + + + + + // === ReadOnlySpan + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Pow3( + this ReadOnlySpan units, Span destination) => units.Pow3(destination); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Pow3( + this ReadOnlySpan units, Span destination) => units.Pow3(destination); + + // === Array === + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Volume[] Pow3(this Length[] units) => units.Pow3(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Volume?[] Pow3(this Length?[] units) => units.Pow3(); + + // === List === + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static List Pow3(this List units) => units.Pow3(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static List Pow3(this List units) => units.Pow3(); + + // === IEnumerable === + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IEnumerable Pow3(this IEnumerable units) => units.Pow3(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IEnumerable Pow3(this IEnumerable units) => units.Pow3(); +} + internal readonly struct LengthConv { diff --git a/QWERTYkez.Mensura/Units/Voltage.cs b/QWERTYkez.Mensura/Units/Voltage.cs index 1662ff4..8ab42ed 100644 --- a/QWERTYkez.Mensura/Units/Voltage.cs +++ b/QWERTYkez.Mensura/Units/Voltage.cs @@ -35,6 +35,29 @@ public readonly partial record struct Voltage public Voltage AddMegaVolts(double value) => new(_Value + VoltageConv.MegaVolts.To(value)); } +public static class VolumeSqrtExtension +{ + // === ReadOnlySpan + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Sqrt3( + this ReadOnlySpan units, Span destination) => units.Sqrt3(destination); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Sqrt3( + this ReadOnlySpan units, Span destination) => units.Sqrt3(destination); + + // === Array === + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Length[] Sqrt3(this Volume[] units) => units.Sqrt3(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Length?[] Sqrt3(this Volume?[] units) => units.Sqrt3(); + + // === List === + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static List Sqrt3(this List units) => units.Sqrt3(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static List Sqrt3(this List units) => units.Sqrt3(); + + // === IEnumerable === + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IEnumerable Sqrt3(this IEnumerable units) => units.Sqrt3(); + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IEnumerable Sqrt3(this IEnumerable units) => units.Sqrt3(); +} + internal readonly struct VoltageConv { private VoltageConv(double multiplicator) => this.Multiplicator = multiplicator;