Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Эм, выглядит как подгон. Проблема с div'ом #50

Open
TeUm3048 opened this issue Oct 31, 2023 · 0 comments
Open

Comments

@TeUm3048
Copy link
Collaborator

TeUm3048 commented Oct 31, 2023

  1. Тесты не работает и не покрывают все ветвления

  2. Зачем в делении нужно умножение?

if num1.number != num2.number.multiply(res.number):
res.number = res.number.add(Natural("1"))
if num1.sign < 0 and num2.sign < 0:
if num1.number != num2.number.multiply(res.number):
res.number = res.number.add(Natural("1"))

  1. Также тут вылетает ошибка:
            if num1.number != num2.number.multiply(res.number):
>               res.number = res.number.add(Natural("1"))
E               NameError: name 'Natural' is not defined

..\..\..\computing\integer\div.py:17: NameError
  1. Строчку 21 можно записать проще. Вместо
    if num1.number != num2.number.multiply(res.number):
    res.number = res.number.add(Natural("1"))
    if num1.sign > 0 and num2.sign < 0:
    res.sign = -1
    return res

    можно написать
    if num1.sign > 0 > num2.sign:

С 14 также

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant