Skip to content

BUG, ENH: Refine Nat checks and division by 0 setting in timedelta division code #17831

Open
@ganesh-k13

Description

@ganesh-k13

I would like to take this as a follow-up PR as we need to make two major changes:
For both timedeltas, we need to do this:

else {
if (((in1 > 0) != (in2 > 0)) && (in1 % in2 != 0)) {
*((@div_op_type@ *)op1) = in1/in2 - 1;

But as I mentioned in #17727 (comment), we are truncating instead of flooring. Second being the setting of invalid division.

Originally posted by @ganesh-k13 in #17727 (comment)

Refers: #17727, #16458
CC: @seberg , @mattip, @eric-wieser

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions