当前位置: 首页>>代码示例>>C#>>正文


C# UInt64.ToString方法代码示例

本文整理汇总了C#中UInt64.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# UInt64.ToString方法的具体用法?C# UInt64.ToString怎么用?C# UInt64.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UInt64的用法示例。


在下文中一共展示了UInt64.ToString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToString

 public static string ToString(UInt64 value)
 {
     return value.ToString();
 }  
开发者ID:nguyenkien,项目名称:api,代码行数:4,代码来源:XmlConvert.cs

示例2: VerifyCtorUInt64

        private static bool VerifyCtorUInt64(UInt64 value)
        {
            bool ret = true;
            BigInteger bigInteger;

            bigInteger = new BigInteger(value);

            if (!bigInteger.Equals(value))
            {
                Console.WriteLine("Expected BigInteger {0} to be equal to UInt64 {1}", bigInteger, value);
                ret = false;
            }
            if (String.CompareOrdinal(value.ToString(), bigInteger.ToString()) != 0)
            {
                Console.WriteLine("UInt64.ToString() and BigInteger.ToString() on {0} and {1} should be equal", value, bigInteger);
                ret = false;
            }
            if (value != (UInt64)bigInteger)
            {
                Console.WriteLine("Expected BigInteger {0} to be equal to UInt64 {1}", bigInteger, value);
                ret = false;
            }

            if (value != UInt64.MaxValue)
            {
                if ((UInt64)(value + 1) != (UInt64)(bigInteger + 1))
                {
                    Console.WriteLine("Adding 1 to both {0} and {1} should remain equal", value, bigInteger);
                    ret = false;
                }
            }

            if (value != UInt64.MinValue)
            {
                if ((UInt64)(value - 1) != (UInt64)(bigInteger - 1))
                {
                    Console.WriteLine("Subtracting 1 from both {0} and {1} should remain equal", value, bigInteger);
                    ret = false;
                }
            }

            Assert.True(VerifyBigintegerUsingIdentities(bigInteger, 0 == value), " Verification Failed");
            return ret;
        }
开发者ID:gitter-badger,项目名称:corefx,代码行数:44,代码来源:ctor.cs

示例3: ToString

 public static string ToString(UInt64 value)
 {
     return value.ToString(null, NumberFormatInfo.InvariantInfo);
 }
开发者ID:shiftkey-tester,项目名称:corefx,代码行数:4,代码来源:XmlConvert.cs

示例4: VerifyCtorByteArray

        private static bool VerifyCtorByteArray(byte[] value, UInt64 expectedValue)
        {
            bool ret = true;
            BigInteger bigInteger;

            bigInteger = new BigInteger(value);

            if (!bigInteger.Equals(expectedValue))
            {
                Console.WriteLine("Expected BigInteger {0} to be equal to UInt64 {1}", bigInteger, expectedValue);
                ret = false;
            }
            if (!expectedValue.ToString().Equals(bigInteger.ToString(), StringComparison.OrdinalIgnoreCase))
            {
                Console.WriteLine("UInt64.ToString() and BigInteger.ToString()");
                ret = false;
            }
            if (expectedValue != (UInt64)bigInteger)
            {
                Console.WriteLine("BigInteger casted to a UInt64");
                ret = false;
            }

            if (expectedValue != UInt64.MaxValue)
            {
                if ((UInt64)(expectedValue + 1) != (UInt64)(bigInteger + 1))
                {
                    Console.WriteLine("BigInteger added to 1");
                    ret = false;
                }
            }

            if (expectedValue != UInt64.MinValue)
            {
                if ((UInt64)(expectedValue - 1) != (UInt64)(bigInteger - 1))
                {
                    Console.WriteLine("BigInteger subtracted by 1");
                    ret = false;
                }
            }

            Assert.True(VerifyCtorByteArray(value), " Verification Failed");
            return ret;
        }
开发者ID:gitter-badger,项目名称:corefx,代码行数:44,代码来源:ctor.cs

示例5: VerifyUInt64ImplicitCastToBigInteger

        private static void VerifyUInt64ImplicitCastToBigInteger(UInt64 value)
        {
            BigInteger bigInteger = value;

            Assert.Equal(value, bigInteger);
            Assert.Equal(value.ToString(), bigInteger.ToString());
            Assert.Equal(value, (UInt64)bigInteger);

            if (value != UInt64.MaxValue)
            {
                Assert.Equal((UInt64)(value + 1), (UInt64)(bigInteger + 1));
            }

            if (value != UInt64.MinValue)
            {
                Assert.Equal((UInt64)(value - 1), (UInt64)(bigInteger - 1));
            }

            VerifyBigIntegerUsingIdentities(bigInteger, 0 == value);
        }
开发者ID:noahfalk,项目名称:corefx,代码行数:20,代码来源:cast_to.cs

示例6: VerifyCtorByteArray

        private static void VerifyCtorByteArray(byte[] value, UInt64 expectedValue)
        {
            BigInteger bigInteger = new BigInteger(value);

            Assert.Equal(expectedValue, bigInteger);
            Assert.True(expectedValue.ToString().Equals(bigInteger.ToString(), StringComparison.OrdinalIgnoreCase), "UInt64.ToString() and BigInteger.ToString()");
            Assert.Equal(expectedValue, (UInt64)bigInteger);

            if (expectedValue != UInt64.MaxValue)
            {
                Assert.Equal((UInt64)(expectedValue + 1), (UInt64)(bigInteger + 1));
            }

            if (expectedValue != UInt64.MinValue)
            {
                Assert.Equal((UInt64)(expectedValue - 1), (UInt64)(bigInteger - 1));
            }

            VerifyCtorByteArray(value);
        }
开发者ID:ChuangYang,项目名称:corefx,代码行数:20,代码来源:ctor.cs

示例7: VerifyCtorUInt64

        private static void VerifyCtorUInt64(UInt64 value)
        {
            BigInteger bigInteger = new BigInteger(value);

            Assert.Equal(value, bigInteger);
            Assert.Equal(0, String.CompareOrdinal(value.ToString(), bigInteger.ToString()));
            Assert.Equal(value, (UInt64)bigInteger);

            if (value != UInt64.MaxValue)
            {
                Assert.Equal((UInt64)(value + 1), (UInt64)(bigInteger + 1));
            }

            if (value != UInt64.MinValue)
            {
                Assert.Equal((UInt64)(value - 1), (UInt64)(bigInteger - 1));
            }

            VerifyBigIntegerUsingIdentities(bigInteger, 0 == value);
        }
开发者ID:ChuangYang,项目名称:corefx,代码行数:20,代码来源:ctor.cs

示例8: AllPrimitivesMethod

 private static string AllPrimitivesMethod(
     bool boolean,
     string str,
     char character,
     byte unsignedbyte,
     sbyte signedbyte,
     Int16 int16,
     UInt16 uint16,
     Int32 int32,
     UInt32 uint32,
     Int64 int64,
     UInt64 uint64,
     Single single,
     Double dbl)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append(boolean.ToString() + ", ");
     builder.Append(str + ", ");
     builder.Append(character.ToString() + ", ");
     builder.Append(unsignedbyte.ToString() + ", ");
     builder.Append(signedbyte.ToString() + ", ");
     builder.Append(int16.ToString() + ", ");
     builder.Append(uint16.ToString() + ", ");
     builder.Append(int32.ToString() + ", ");
     builder.Append(uint32.ToString() + ", ");
     builder.Append(int64.ToString() + ", ");
     builder.Append(uint64.ToString() + ", ");
     builder.Append(single.ToString() + ", ");
     builder.Append(dbl);
     return builder.ToString();
 }
开发者ID:Corillian,项目名称:corefx,代码行数:31,代码来源:DelegateTests.cs


注:本文中的UInt64.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。