Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Gmpz constructed from non-integer double value

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Gmpz constructed from non-integer double value


Chronological Thread 
  • From: Martin Baeker <>
  • To:
  • Subject: Re: [cgal-discuss] Gmpz constructed from non-integer double value
  • Date: Thu, 3 Jun 2010 12:38:54 +0200 (CEST)
  • Organization: Institut fuer Werkstoffe TU Braunschweig

Perhaps you could use Gmpq instead, that easily allows for arbitrary
rationals.


Thanks, what should I do for general floats?

----- Original Message -----
From: "Stefan Schirra"
<>
To:
<>
Sent: Thursday, June 03, 2010 4:41 PM
Subject: Re: [cgal-discuss] Gmpz constructed from non-integer double value


Jianfei Liu wrote:
I am reading a simple .off file and traslate it from polyhedron to Nef
polyhedron, but failed with an error:Gmpz constructed from non-integer double
value.

The error message says it all: 0.256 is not an integer, whereas Gmpz is an
integer-type. You cannot convert arbitrary floats to this type. Only floats
representing integral values can be converted.

I noticed somebody says it is a bug for older CGAL, however it seems still
existing for the newest version 3.6.
OFF
4 4 0

0 0 0.256
1 0 0
0 1 0
0 0 1

3 0 2 1
3 0 1 3
3 0 3 2
3 1 2 3

The problem is caused by 0.256 in the above file.

Multiply your coordinates by 1000 ;-)



-- Stefan

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss

Priv.-Doz. Dr. Martin Bäker
Institut für Werkstoffe
Technische Universität Braunschweig
Langer Kamp 8
38106 Braunschweig
Germany
Tel.: 00-49-531-391-3073
Fax 00-49-531-391-3058
e-mail
<>


Archive powered by MHonArc 2.6.16.

Top of Page