double.IsInfinity()

Here are the examples of the csharp api double.IsInfinity() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

8 Examples 7

19 Source : UIScale.cs
with GNU General Public License v3.0
from yhuse

public float[] CalcXPixels(double[] labels, int origin, int width)
        {
            if (labels == null) return null;
            float[] result = new float[labels.Length];
            for (int i = 0; i < labels.Length; i++)
            {
                if (labels[i].IsInfinity() || labels[i].IsNan())
                    result[i] = float.NaN;
                else
                    result[i] = CalcXPixel(labels[i], origin, width);
            }

            return result;
        }

19 Source : UILineChartOption.cs
with GNU General Public License v3.0
from yhuse

public void Add(string x, double y)
        {
            int cnt = XData.Count;
            XData.Add(cnt);
            if (y.IsInfinity()) y = double.NaN;
            if (y.IsNan()) ContainsNan = true;
            YData.Add(y);
        }

19 Source : UOther.cs
with GNU General Public License v3.0
from yhuse

public static bool IsNanOrInfinity(this double d)
        {
            return d.IsNan() || d.IsInfinity();
        }

19 Source : UILineChartOption.cs
with GNU General Public License v3.0
from yhuse

public void GetAllDataXRange(out double min, out double max)
        {
            if (AllDataCount() == 0)
            {
                min = 0;
                max = 1;
            }
            else
            {
                min = double.MaxValue;
                max = double.MinValue;

                foreach (var series in Series.Values)
                {
                    if (series.DataCount > 0)
                    {
                        if (series.ContainsNan)
                        {
                            foreach (var d in series.XData)
                            {
                                if (d.IsNan() || d.IsInfinity()) continue;
                                min = Math.Min(min, d);
                                max = Math.Max(max, d);
                            }
                        }
                        else
                        {
                            min = Math.Min(min, series.XData.Min());
                            max = Math.Max(max, series.XData.Max());
                        }
                    }
                }
            }
        }

19 Source : UILineChartOption.cs
with GNU General Public License v3.0
from yhuse

public void Add(double x, double y)
        {
            XData.Add(x);
            if (y.IsInfinity()) y = double.NaN;
            if (y.IsNan()) ContainsNan = true;
            YData.Add(y);
        }

19 Source : UILineChartOption.cs
with GNU General Public License v3.0
from yhuse

public void Add(DateTime x, double y)
        {
            DateTimeInt64 t = new DateTimeInt64(x);
            XData.Add(t);
            if (y.IsInfinity()) y = double.NaN;
            if (y.IsNan()) ContainsNan = true;
            YData.Add(y);
        }

19 Source : UIScale.cs
with GNU General Public License v3.0
from yhuse

public float[] CalcYPixels(double[] labels, int origin, int height)
        {
            if (labels == null) return null;
            float[] result = new float[labels.Length];
            for (int i = 0; i < labels.Length; i++)
            {
                if (labels[i].IsInfinity() || labels[i].IsNan())
                    result[i] = float.NaN;
                else
                    result[i] = CalcYPixel(labels[i], origin, height);
            }

            return result;
        }

19 Source : UILineChartOption.cs
with GNU General Public License v3.0
from yhuse

public void GetAllDataYRange(out double min, out double max)
        {
            if (AllDataCount() == 0)
            {
                min = 0;
                max = 1;
            }
            else
            {
                min = double.MaxValue;
                max = double.MinValue;
                foreach (var series in Series.Values)
                {
                    if (series.DataCount > 0)
                    {
                        if (series.ContainsNan)
                        {
                            foreach (var d in series.YData)
                            {
                                if (d.IsNan() || d.IsInfinity()) continue;
                                min = Math.Min(min, d);
                                max = Math.Max(max, d);
                            }
                        }
                        else
                        {
                            min = Math.Min(min, series.YData.Min());
                            max = Math.Max(max, series.YData.Max());
                        }
                    }
                }
            }
        }