Opened 10 years ago

Closed 10 years ago

#442 closed bug (fixed)

Inconsistent int % int vs. bigint % bigint

Reported by: dreyer Owned by: somebody
Priority: minor Milestone: 3-1-5 and higher
Component: dontKnow Version: 3-1-5
Keywords: Cc:

Description

The result of modulo operation are inconsistent for negative numbers:

> int(10) % 7;
3
> bigint(10) % 7;
3
>  int(-10) % 7;
-3
> bigint(-10) % 7;
4
> bigint(-10) % bigint(7);
4

(tested with recent git master branch)

Change History (3)

comment:1 Changed 10 years ago by Oleksandr

comment:2 in reply to:  1 Changed 10 years ago by dreyer

Replying to motsak:

it seems related to http://www.singular.uni-kl.de:8002/trac/ticket/436 no?

Possibly, but it's not spielwiese.

comment:3 Changed 10 years ago by hannes

Resolution: fixed
Status: newclosed

main difference to #436:

  • 436 is about bigint, 442 ist about int
  • 436 is (mainly) about the internal nlIntDiv/nlIntMod, 442 is about the interpreter

fixed, by making mod an alias to %

Note: See TracTickets for help on using tickets.