diff --git a/coders/sun.c b/coders/sun.c
index f3901fd..56f4a64 100644
--- a/coders/sun.c
+++ b/coders/sun.c
@@ -900,7 +900,7 @@
             for (x=0; x < (ssize_t) image->columns; x++)
             {
               byte<<=1;
-              if (GetPixelIntensity(image,p) < (MagickRealType) (QuantumRange/2.0))
+              if (GetPixelIntensity(image,p) < (double) (QuantumRange/2.0))
                 byte|=0x01;
               bit++;
               if (bit == 8)