Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Programming Articles - Page 2333 of 3366
307 Views
The MathF.Sqrt() method in C# is used to compute the square root of the floating-point value.SyntaxFollowing is the syntax −public static float Sqrt (float val);Above, Val is the number whose square root is to be computed.ExampleLet us now see an example to implement the MathF.Sqrt() method −using System; public class Demo { public static void Main(){ float val1 = 36f; float val2 = float.NaN; Console.WriteLine("MathF.Sqrt(val1) = "+MathF.Sqrt(val1)); Console.WriteLine("MathF.Sqrt(val2) = "+MathF.Sqrt(val2)); } }OutputThis will produce the following output −MathF.Sqrt(val1) = 6 MathF.Sqrt(val2) = NaNExampleLet us now see ... Read More
122 Views
The MathF.Sinh() method in C# returns the hyperbolic sine of a floating-point argument.SyntaxFollowing is the syntax −public static float Sinh (float val);Above, Val is the number whose hyperbolic sine is to be returned.ExampleLet us now see an example to implement the MathF.Sinh() method −using System; public class Demo { public static void Main(){ float val1 = float.PositiveInfinity; float val2 = float.NegativeInfinity; float val3 = (20f * (MathF.PI)) / 180; Console.WriteLine("MathF.Sinh(val1) = "+MathF.Sinh(val1)); Console.WriteLine("MathF.Sinh(val2) = "+MathF.Sinh(val2)); Console.WriteLine("MathF.Sinh(val3) = "+MathF.Sinh(val3)); } }OutputThis ... Read More
165 Views
The MathF.Sin() method in C# is used to return the sine of a given float value argument.SyntaxFollowing is the syntax −public static float Sin (float val);Above, Val is the angle whose sine is to be returned.ExampleLet us now see an example to implement the MathF.Sin() method −using System; public class Demo { public static void Main(){ float val1 = 10f; float val2 = float.NaN; Console.WriteLine("MathF.Tan(val1) = "+MathF.Tan(val1)); Console.WriteLine("MathF.Tan(val2) = "+MathF.Tan(val2)); } }OutputThis will produce the following output −MathF.Sign(val1) = -0.5440211 MathF.Sign(val2) = NaNExampleLet us now see ... Read More
950 Views
The DateTime.CompareTo() method in C# is used to compare the value of this instance to a specified DateTime value.SyntaxFollowing is the syntax −public int CompareTo (DateTime val);Above, Val is the date to be compared.It returns an integer value, 0 − If this instance is later than ValExampleLet us now see an example to implement the DateTime.CompareTo() method −using System; public class Demo { public static void Main(){ DateTime date1 = new DateTime(2019, 05, 20, 6, 20, 40); DateTime date2 = new DateTime(2019, 05, 20, 6, 20, 40); Console.WriteLine("DateTime 1 = ... Read More
196 Views
The Type.GetInterfaces() method in C# is used to get all the interfaces implemented or inherited by the current Type.SyntaxFollowing is the syntax −public abstract Type[] GetInterfaces ();ExampleLet us now see an example to implement the Type.GetInterfaces() method −using System; public class Demo { public static void Main(){ Type type = typeof(float); Type myInterface = type.GetInterface("IFormattable", true); Type[] myInterfaces = type.GetInterfaces(); Console.WriteLine("Interface = "+myInterface); Console.WriteLine("All the Interfaces..."); for (int i = 0; i < myInterfaces.Length; i++) Console.WriteLine(""+myInterfaces[i]); } ... Read More
238 Views
The Type.GetInterface() method in C# is used to get a specific interface implemented or inherited by the current Type.SyntaxFollowing is the syntax −public Type GetInterface (string name); public abstract Type GetInterface (string name, bool ignoreCase);ExampleLet us now see an example to implement the Type.GetInterface() method −using System; public class Demo { public static void Main(){ Type type = typeof(double); Type myInterface = type.GetInterface("IFormattable"); Console.WriteLine("Interface = "+myInterface); } }OutputThis will produce the following output −Interface = System.IFormattableExampleLet us now see another example to implement the Type.GetInterface() method −using System; public ... Read More
96 Views
The UInt64.GetTypeCode() method in C# is used to return the TypeCode for value type UInt64.SyntaxFollowing is the syntax −public TypeCode GetTypeCode ();ExampleLet us now see an example to implement the UInt64.GetTypeCode() method −using System; public class Demo { public static void Main(){ ulong val1 = 55; ulong val2 = 100; TypeCode type1 = val1.GetTypeCode(); TypeCode type2 = val2.GetTypeCode(); Console.WriteLine("Typecode for val1 = "+type1); Console.WriteLine("Typecode for val2 = "+type2); } }OutputThis will produce the following output −Typecode for val1 = UInt64 ... Read More
116 Views
The UInt64.GetHashCode() method in C# is used to get the HashCode for the current UInt64 instance.SyntaxFollowing is the syntax −public override int GetHashCode ();ExampleLet us now see an example to implement the UInt64.GetHashCode() method −using System; public class Demo { public static void Main(){ ulong val1 = 8768768; ulong val2 = UInt64.MinValue; Console.WriteLine("HashCode for val1 = "+val1.GetHashCode()); Console.WriteLine("HashCode for val2 = "+val2.GetHashCode()); } }OutputThis will produce the following output −HashCode for val1 = 8768768 HashCode for val2 = 0ExampleLet us now see another example to implement ... Read More
124 Views
The UInt64.Equals() method in C# returns a value indicating whether this instance is equal to a specified object or UInt64.SyntaxFollowing is the syntax −public override bool Equals (object ob); public bool Equals (ulong ob);Above, the parameter ob for the 1st syntax is an object to compare to this instance and the parameter ob for the 2nd syntax is the 64-bit unsigned integer to compare to this instance.ExampleLet us now see an example to implement the UInt64.Equals() method −using System; public class Demo { public static void Main(){ ulong val1 = 44565777; ulong val2 ... Read More
184 Views
The UInt64.CompareTo() method in C# is used to compare the current instance to a specified object or UInt64 and returns an indication of their relative values.SyntaxFollowing is the syntax −public int CompareTo (object val); public int CompareTo (ulong val;Above, the value for the 1st syntax is an object to compare. The value for 2nd syntax is an unsigned integer to compare.The return value is 0 if the current instance is equal to value. It’s less than zero if the current instance is less than Val. The return value is more than zero if the current instance is greater than the ... Read More