>
সিনট্যাক্স
সিনট্যাক্স নিম্নরূপ -
public static bool IsNegativeInfinity (double val);
উপরে, val হল একটি দ্বি-নির্ভুল ফ্লোটিং-পয়েন্ট সংখ্যা।
উদাহরণ
আসুন এখন একটি উদাহরণ দেখি -
using System;
public class Demo {
public static void Main(){
double d = 0.0/0;
Console.WriteLine("Double Value = "+d);
Console.WriteLine("HashCode of Double Value = "+d.GetHashCode());
TypeCode type = d.GetTypeCode();
Console.WriteLine("TypeCode of Double Value = "+type);
Console.WriteLine("Positive Infinity? = "+Double.IsInfinity(d));
Console.WriteLine("Check whether the specified value is NaN? = "+Double.IsNaN(d));
Console.WriteLine("Does the value evaluate to negative infinity? = "+Double.IsNegativeInfinity(d));
}
} আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেDouble Value = NaN HashCode of Double Value = -524288 TypeCode of Double Value = Double Positive Infinity? = False Check whether the specified value is NaN? = True Does the value evaluate to negative infinity? = False
উদাহরণ
এখন আরেকটি উদাহরণ দেখা যাক -
using System;
public class Demo {
public static void Main(){
double d = -1.0/0.0;
Console.WriteLine("Double Value = "+d);
Console.WriteLine("HashCode of Double Value = "+d.GetHashCode());
TypeCode type = d.GetTypeCode();
Console.WriteLine("TypeCode of Double Value = "+type);
Console.WriteLine("Positive Infinity? = "+Double.IsInfinity(d));
Console.WriteLine("Check whether the specified value is NaN? = "+Double.IsNaN(d));
Console.WriteLine("Does the value evaluate to negative infinity? = "+Double.IsNegativeInfinity(d));
}
} আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেDouble Value = -∞ HashCode of Double Value = -1048576 TypeCode of Double Value = Double Positive Infinity? = True Check whether the specified value is NaN? = False Does the value evaluate to negative infinity? = True