]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/pixel-private.h
(no commit message)
[imagemagick] / MagickCore / pixel-private.h
index ec296e2453ec8762398cdbab92a78deaa3d3e1a7..9614017c080d00e83cb459d8e674e7c22296d2a5 100644 (file)
@@ -1,12 +1,12 @@
 /*
   Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
   dedicated to making software imaging solutions freely available.
-  
+
   You may not use this file except in compliance with the License.
   obtain a copy of the License at
-  
+
     http://www.imagemagick.org/script/license.php
-  
+
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 extern "C" {
 #endif
 
-static inline MagickRealType MagickEpsilonReciprocal(const MagickRealType x)
+static inline double MagickEpsilonReciprocal(const double x)
 {
-  return((MagickRealType) 1.0/(((x) > (MagickRealType) 0.0 ? (x) : -(x)) <
-    MagickEpsilon ? MagickEpsilon : x));
+  double sign = x < (double) 0.0 ? (double) -1.0 : 
+    (double) 1.0;
+  return((sign*x) >= MagickEpsilon ? (double) 1.0/x : sign*(
+    (double) 1.0/MagickEpsilon));
 }
 
 #if defined(__cplusplus) || defined(c_plusplus)