/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System.Numerics/Complex/Overview/csharp/nan1.cs
28 строк
738 B
Genevieve Warren
Add remarks for core types (#38970)
05 янв 2024, 22:14
Не верифицирован
05 янв 2024, 22:14
71d1377
Код
Авторство
О чём код?
// <Snippet3> using System; using System.Numerics; public class NaNEx { public static void Main() { Complex c1 = new Complex(Double.MaxValue / 2, Double.MaxValue / 2); Complex c2 = c1 / Complex.Zero; Console.WriteLine(c2.ToString()); c2 = c2 * new Complex(1.5, 1.5); Console.WriteLine(c2.ToString()); Console.WriteLine(); Complex c3 = c1 * new Complex(2.5, 3.5); Console.WriteLine(c3.ToString()); c3 = c3 + new Complex(Double.MinValue / 2, Double.MaxValue / 2); Console.WriteLine(c3); } } // The example displays the following output: // (NaN, NaN) // (NaN, NaN) // (NaN, Infinity) // (NaN, Infinity) // </Snippet3>