diff options
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/Numerics/ConstantHelper.tt')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Numerics/ConstantHelper.tt | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Numerics/ConstantHelper.tt b/src/System.Private.CoreLib/shared/System/Numerics/ConstantHelper.tt index 4b1c67757..dd823abc0 100644 --- a/src/System.Private.CoreLib/shared/System/Numerics/ConstantHelper.tt +++ b/src/System.Private.CoreLib/shared/System/Numerics/ConstantHelper.tt @@ -20,19 +20,20 @@ namespace System.Numerics { internal class ConstantHelper { -<# foreach (var type in supportedTypes) +<# + foreach (var type in supportedTypes) { string hexValue = "0x" + new string('f', Marshal.SizeOf(type) * 2); #> [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] - public static <#= type.Name #> Get<#= type.Name #>WithAllBitsSet() + public static <#= typeAliases[type] #> Get<#= type.Name #>WithAllBitsSet() { - <#= type.Name #> value = 0; + <#= typeAliases[type] #> value = 0; unsafe { unchecked { - *((<#= GetIntegralEquivalent(type).Name #>*)&value) = (<#=GetIntegralEquivalent(type).Name#>)<#= hexValue #>; + *((<#= typeAliases[GetIntegralEquivalent(type)] #>*)&value) = (<#= typeAliases[GetIntegralEquivalent(type)] #>)<#= hexValue #>; } } return value; @@ -44,17 +45,17 @@ namespace System.Numerics }<#+ public Type GetIntegralEquivalent(Type type) { - if (type == typeof(Single)) + if (type == typeof(float)) { - return typeof(Int32); + return typeof(int); } else if (type == typeof(double)) { - return typeof(Int64); + return typeof(long); } else { return type; } } -#>
\ No newline at end of file +#> |