Repository navigation
Conversation
Questionable whether this is needed, but it is cheap and avoids some accidents.
It is safe on all the compilers we support, but the version with memcpy and shift avoids explicit handling of byte order.
|
In one commit you write "fix", Is there a small cpp to show the problem? |
#define CGAL_USE_GMPXX
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <iostream>
#include <cassert>
int main(){
mpz_class z=-1;
CGAL::Mpzf f=z;
assert(f<0);
}The assertion fails with current master (it doesn't copy the sign). I think you get the same error with Gmpz instead of mpz_class. The main use case for Mpzf in CGAL only has constructions from |
|
I guess you are confident in the code and we can consider four eyes having had a look at it, as you mention Bruno, or do you expect a review? |
Bugs are always possible... Bit manipulations can be tricky, and off-by-1 errors can appear quite easily.
Bruno reported some of the issues, but never looked at the patch.
As you prefer.
Doesn't feel super useful, but ok... |
|
Hi guys, I can take a look if you want. |
Summary of Changes
Each commit has a separate change, to make it easier to follow. The first patch was motivated by @BrunoLevy (thanks!).
These changes do not affect the use of Mpzf in Epick, but they can be relevant for other uses.
I was also thinking of improving to_double (make it correctly rounded?), but motivation stopped, so maybe some other time.
Release Management