Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] splitting into integer/fractional part

Subject: CGAL users discussion list

List archive

[cgal-discuss] splitting into integer/fractional part


Chronological Thread 
  • From: Maarten Moesen <>
  • To: "" <>
  • Subject: [cgal-discuss] splitting into integer/fractional part
  • Date: Fri, 24 Jul 2009 14:52:08 +0200
  • Accept-language: en-US, nl-BE
  • Acceptlanguage: en-US, nl-BE

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.

Thanks!

Maarten Moesen

  • [cgal-discuss] splitting into integer/fractional part, Maarten Moesen, 07/24/2009

Archive powered by MHonArc 2.6.16.

Top of Page