[Dune] bigunsignedint operator=X

Ansgar Burchardt Ansgar.Burchardt at tu-dresden.de
Wed Mar 22 12:44:01 CET 2017


On Wed, 2017-03-22 at 12:25 +0100, Christian Engwer wrote:
> > Could we omit the division and modulo operators ("/" and
> > "%")?  They
> > are implemented in a very inefficient way and I would rather see
> > them removed from `bigunsignedint`.
> 
> do you have a reference to a better approach?

Well, any other algorithm should beat division by repeated subtraction.
 Long division for example[1] (and long division is still a slow
algorithm).

Though I don't know if we need division for `bigunsignedint` at all in
DUNE?  Even bugs in "-" were not noticed for years.  IIRC the class is
only used for ids in some places (YaspGrid); it very likely doesn't
have to provide full integer arithmetics.

Ansgar

  [1] https://en.wikipedia.org/wiki/Division_algorithm#Integer_division
_.28unsigned.29_with_remainder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6519 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20170322/e6391825/attachment.bin>


More information about the Dune mailing list