CGAL / cgal

The public CGAL repository, see the README below
https://github.com/CGAL/cgal#readme
Other
4.95k stars 1.38k forks source link

Broken to_interval(cpp_int) for large numbers #5990

Open mglisse opened 3 years ago

mglisse commented 3 years ago

Issue Details

Noticed by @danston in #5937. Boost's number::compare is implemented by converting the argument to number, so it doesn't support infinities (it wouldn't return something very useful for I(2).compare(2.3) either). This will likely be fixed by dropping this implementation of to_interval in favor of a new one, but it seems useful to track this bug.

Source Code

#include <CGAL/boost_mp.h>
typedef boost::multiprecision::cpp_int I;
int main(){
  I i = 1;
  i <<= 10000;
  CGAL::to_interval(i);
}

terminate called after throwing an instance of 'boost::wrapexcept<std::runtime_error>' what(): Cannot convert a non-finite number to an integer.

muhd360 commented 1 month ago

@mglisse can i get some reading regarding this issue