Skip to content

Incorrect product sign for negative values #26

Description

@louiev
typedef long double ldbl;

const int imax = numeric_limits< int >::min();
ldbl xdbl = pow(static_cast< ldbl >(imax), 5);
Dodecahedron::Bigint ibig = imax;
Dodecahedron::Bigint xbig = ibig.pow(5);

imax = -2147483648
xdbl = -4.56719e+046
xbig = 45671926166590716193865151022383844364247891968

The sign is incorrect for xbig.

The same incorrect result is obtained with
Dodecahedron::Bigint xbig = ibig * ibig * ibig * ibig * ibig;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions