1 | initial version |
This is not an answer, but a possible clue that it is a problem of ARB and not the SageMath wrapper.
When I run this code in my IDE:
#include "flint/arb.h"
int main(int argc, char **argv)
{
arb_t a;
arb_init(a);
slong prec;
prec = 256;
arb_set_d(a, 1.1);
arb_printd(a, 40);
printf(" WRONG \n");
arb_set_str(a, "1.1", prec);
arb_printd(a, 40);
printf(" FINE \n");
arb_set_d(a, 1);
arb_printd(a, 40);
printf(" FINE \n");
arb_clear(a);
return 0;
}
I obtain:
1.100000000000000088817841970012523233891 +/- 0 WRONG
1.100000000000000000000000000000000000000 +/- 1.7272e-77 FINE
1.000000000000000000000000000000000000000 +/- 0 FINE
This clearly shows that the issue originates from the "arb_det_d" function when fed with a non-integer value. I will ask about this on the FLINT GitHub issue list.
2 | No.2 Revision |
This is not an answer, but a possible clue that it is a problem of ARB and not the SageMath wrapper.
When I run this code in my IDE:
#include "flint/arb.h"
int main(int argc, char **argv)
{
arb_t a;
arb_init(a);
slong prec;
prec = 256;
arb_set_d(a, 1.1);
arb_printd(a, 40);
printf(" WRONG \n");
arb_set_str(a, "1.1", prec);
arb_printd(a, 40);
printf(" FINE \n");
arb_set_d(a, 1);
arb_printd(a, 40);
printf(" FINE \n");
arb_clear(a);
return 0;
}
I obtain:
1.100000000000000088817841970012523233891 +/- 0 WRONG
1.100000000000000000000000000000000000000 +/- 1.7272e-77 FINE
1.000000000000000000000000000000000000000 +/- 0 FINE
This clearly shows that the issue originates from the "arb_det_d" function when fed with a non-integer value. I will ask about this on the FLINT GitHub issue list.
EDIT: Here is the ARB/Flint thread adequately explaining the observed phenomenon and showing my lack of understanding of what "inexactness" implies: https://github.com/flintlib/flint/issues/1786