float structure and its methods in C#

Learn: skim structure and its strategies in C#.Net, it’s a predefined structure of .Net system; here we will examine its techniques and properties with example.

glide is a pre-characterized structure of .NET system class library. Also, as we realize that each structure in the .NET system contains a few strategies and properties to work on it.

There are the following significant techniques for int structure:

  1. float.Equals()
  2. float.Parse()
  3. float.MaxValue
  4. float.MinValue

1) float.Equals

This technique is utilized to check two given buoy object are equivalent or not. It returns a boolean outcome.

2) float.Parse()

This technique is utilized to change over or parse the string to skim.

3) float.MaxValue

This is a get property of buoy structure. It returns the most extreme conceivable estimation of buoy variable.

4) float.MinValue

This is a get property of buoy structure. It returns the most extreme conceivable estimation of buoy variable.

All the above technique can without much of a stretch comprehend with the assistance of the program:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            bool flag = false;
            float val;

            val = float.Parse("12.5");

            Console.WriteLine("Value is : "+val);

            flag = char.Equals(123.25,123.25);

            if(flag == true)
                Console.WriteLine("Both are equal");
            else
                Console.WriteLine("Both are not equal");

            Console.WriteLine("MaxValue of byte : " + float.MaxValue);
            Console.WriteLine("MinValue of byte : " + float.MinValue);
            
        }
    }
}

Above program produce the following outcome:

Output:

Value is : 12.5
Both are equal
MaxValue of byte : 3.402823E+38
MinValue of byte : -3.402823E+38

Leave a Comment

error: Alert: Content is protected!!