Subject: CGAL users discussion list
List archive
- From: Ashwin Nanjappa <>
- To:
- Subject: Re: [cgal-discuss] splitting into integer/fractional part
- Date: Fri, 21 Aug 2009 17:05:58 +0800
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=b276vzZdxnft4OJawmun/ljar+z1NOhp/6gXK9J+H5nBLQL7Wxo00hhECpVSwsQjd1 yIGxkdz/Mo513qtuAy+tUNshsfnho2G3yxuOLmjSOiNZUU2s+9wD5tzAbWCmO/Z5WgXy cKVoJkMu58G89Kz7x6iVS6B05iLFLUR4nU4CY=
On Fri, Jul 24, 2009 at 20:52, Maarten
Moesen<>
wrote:
> Dear all,
>
> What is the best way of splitting a number represented by a CGAL exact
> predicates kernel into its integer and fractional part?
> Currently, I'm using the exact_predicates_inexact_constructions_kernel and
> I'd like to implement what works for doubles as:
>
> int integer_part = static_cast<int>(floor(x))
> double fractional_part = x - int_part
>
> Is there something similar to floor()?
> I'm not using the function modf as it behaves differently (undesired) for
> negative numbers.
> My goal is to partition 3d space according to a regular 3d lattice.
Are you sure that CGAL::to_double() and modf() are not suitable for
your purpose? What is undesirable in the behaviour of modf()?
~ash
- Re: [cgal-discuss] splitting into integer/fractional part, Ashwin Nanjappa, 08/21/2009
Archive powered by MHonArc 2.6.16.