# «DivideByZero» (Решение)

## Ответ

```
Infinity
Infinity
DivideByZeroException
```

## Объяснение

Первые две строчки выполнятся и выведут `Infinity`. При деление произойдёт конвертация `int` к `double`, а операция `double operator /(double x, double y)` выполняется согласно IEEE 754 (ECMA-334, 14.7.2), а значит при делении положительного числа на положительный ноль должна вернуть положительную бесконечность. Операция `int operator /(int x, int y)` бросает `DivideByZeroException` в случае, если правый операнд равен нулю (ECMA-334, 14.7.2). Поэтому третья операция деление выбросит исключение, о чём будет выведено соответствующее сообщение.

[Задача](/problembookdotnet/ru/math/dividebyzero-p.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://andreyakinshin.gitbook.io/problembookdotnet/ru/math/dividebyzero-s.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
