[vtk-developers] Dashboard problems: ambiguous conversion fabs() call

David Gobbi david.gobbi at gmail.com
Thu Aug 16 09:58:45 EDT 2012


On Thu, Aug 16, 2012 at 7:39 AM, Kyle Lutz <kyle.lutz at kitware.com> wrote:
>
> Also, did you mean std::abs()? std::fabs() is not overloaded for the
> integral types and std::abs() should be preferred anyway.

In code that is only meant to be used for floating-point numbers, I
prefer std::fabs() because I _like_ the fact that it produces an error
if an integer slips in. But for vtkTuple, where both ints and floats
are possible, std::abs() is the clear winner.

 - David



More information about the vtk-developers mailing list