Index: trunk/SophyaLib/SkyMap/HEALPixUtils.cc
===================================================================
--- trunk/SophyaLib/SkyMap/HEALPixUtils.cc	(revision 1954)
+++ trunk/SophyaLib/SkyMap/HEALPixUtils.cc	(revision 2082)
@@ -142,5 +142,5 @@
       else 
 	{
-	  ID = (int)fmod(J,2);
+	  ID = J%2;  //RzModFloor (int)fmod(J,2);
 	  J  = J/2;
 	  K  = IP*ID+K;
@@ -232,5 +232,5 @@
   if( jp<1 )   jp = jp + nl4;
   
-  int aux=n_before + jp - 1;
+  //RzDel int aux=n_before + jp - 1;
   return (n_before + jp - 1);// ! in {0, npix-1}
 }
@@ -295,8 +295,8 @@
     
     ip    = ipring1 - ncap - 1;
-    irn   = (int)floor( ip / nl4 ) + nside;//               ! counted from North pole
-    iphi  = (int)fmod(ip,nl4) + 1;
-    
-    kshift  = (int)fmod(irn+nside,2);//  ! 1 if irn+nside is odd, 0 otherwise
+    irn   = ip / nl4 + nside; //RzModFloor (int)floor( ip / nl4 ) + nside;   ! counted from North pole
+    iphi  = ip%nl4 + 1;  //RzModFloor (int)fmod(ip,nl4) + 1;
+    
+    kshift  = (irn+nside)%2; //RzModFloor (int)fmod(irn+nside,2);  ! 1 if irn+nside is odd, 0 otherwise
     nr = nside;
     ire =  irn - nside + 1;// ! in {1, 2*nside +1}
@@ -305,5 +305,5 @@
     ifp = (iphi - irm/2 + nside -1) / nside;
     if( ifp==ifm ) {//then          ! faces 4 to 7
-      face_num = (int)fmod(ifp,4) + 4;
+      face_num = ifp%4+4; // RzModFloor (int)fmod(ifp,4) + 4;
     }
     else if( ifp + 1==ifm ) {//then ! (half-)faces 0 to 3
@@ -338,7 +338,7 @@
   iy = -(ipt + irt ) / 2;
   
-  ix_low = (int)fmod(ix,128);
+  ix_low = ix%128; //RzModFloor (int)fmod(ix,128);
   ix_hi  = ix/128;
-  iy_low = (int)fmod(iy,128);
+  iy_low = iy%128; //RzModFloor (int)fmod(iy,128); 
   iy_hi  = iy/128;
   ipf=(PXY.x2pix_(ix_hi)+PXY.y2pix_(iy_hi))*(128*128)+(PXY.x2pix_(ix_low)+PXY.y2pix_(iy_low));
@@ -397,7 +397,9 @@
     ir = nside + 1 + jp - jm;// ! in {1,2n+1} (ring number counted from z=2/3)
     kshift = 0;
-    if (fmod(ir,2)==0.) kshift = 1;// ! kshift=1 if ir even, 0 otherwise
-    
-    ip = (int)floor( ( jp+jm - nside + kshift + 1 ) / 2 ) + 1;// ! in {1,4n}
+    //RzModFloor if (fmod(ir,2)==0.) kshift = 1; ! kshift=1 if ir even, 0 otherwise
+    if ((ir%2)==0) kshift = 1;// ! kshift=1 if ir even, 0 otherwise
+    
+    //RzModFloor ip = (int)floor( ( jp+jm - nside + kshift + 1 ) / 2 ) + 1; ! in {1,4n}
+    ip = ( jp+jm - nside + kshift + 1 )/2  + 1;  
     if( ip>nl4 ) ip = ip - nl4;
     
@@ -477,10 +479,10 @@
     ifp = jp / ns_max;//  ! in {0,4}
     ifm = jm / ns_max;
-    if( ifp==ifm ) face_num = (int)fmod(ifp,4) + 4; //then  ! faces 4 to 7
-    else if( ifp<ifm ) face_num = (int)fmod(ifp,4); // (half-)faces 0 to 3
-    else face_num = (int)fmod(ifm,4) + 8;//! (half-)faces 8 to 11
-    
-    ix = (int)fmod(jm, ns_max);
-    iy = ns_max - (int)fmod(jp, ns_max) - 1;
+    if( ifp==ifm ) face_num = (ifp%4)+4; //RzModFloor (int)fmod(ifp,4) + 4; then  ! faces 4 to 7
+    else if( ifp<ifm ) face_num = ifp%4; //RzModFloor (int)fmod(ifp,4); (half-)faces 0 to 3
+    else face_num = (ifm%4) + 8; //RzModFloor (int)fmod(ifm,4) + 8;! (half-)faces 8 to 11
+    
+    ix = jm%ns_max; //RzModFloor (int)fmod(jm, ns_max);
+    iy = ns_max - (jp%ns_max) - 1;//RzModFloor  ns_max - (int)fmod(jp, ns_max) - 1;
   }
   else { //! polar region, za > 2/3
@@ -510,7 +512,7 @@
   }
   
-  ix_low = (int)fmod(ix,128);
+  ix_low = (ix%128); //RzModFloor (int)fmod(ix,128);
   ix_hi  =     ix/128;
-  iy_low = (int)fmod(iy,128);
+  iy_low = (iy%128); //RzModFloor ((int)fmod(iy,128);
   iy_hi  =     iy/128;
   ipf= (PXY.x2pix_(ix_hi)+PXY.y2pix_(iy_hi))*(128*128)+(PXY.x2pix_(ix_low)+PXY.y2pix_(iy_low));
@@ -571,5 +573,5 @@
     
     ip    = ipix1 - ncap - 1;
-    iring = (int)floor( ip / nl4 ) + nside;// ! counted from North pole
+    iring = ip/nl4  + nside; //RzModFloor (int)floor( ip / nl4 ) + nside; ! counted from North pole
     iphi  = ip%nl4 + 1;
     
@@ -639,11 +641,11 @@
   
   face_num = ipix/npface;//  ! face number in {0,11}
-  ipf = (int)fmod(ipix,npface);//  ! pixel number in the face {0,npface-1}
+  ipf = ipix%npface; //RzModFloor (int)fmod(ipix,npface);  ! pixel number in the face {0,npface-1}
   
   //c     finds the x,y on the face (starting from the lowest corner)
   //c     from the pixel number
-  ip_low = (int)fmod(ipf,1024);//       ! content of the last 10 bits
+  ip_low = ipf%1024; //RzModFloor  (int)fmod(ipf,1024);      ! content of the last 10 bits
   ip_trunc =   ipf/1024 ;//       ! truncation of the last 10 bits
-  ip_med = (int)fmod(ip_trunc,1024);//  ! content of the next 10 bits
+  ip_med = ip_trunc%1024;  //RzModFloor  (int)fmod(ip_trunc,1024);  ! content of the next 10 bits
   ip_hi  =     ip_trunc/1024   ;//! content of the high weight 10 bits
   
@@ -660,5 +662,5 @@
   nr = nside;//                  ! equatorial region (the most frequent)
   z  = (2*nside-jr)*fact2;
-  kshift = (int)fmod(jr - nside, 2);
+  kshift = (jr-nside) % 2; //RzModFloor (int)fmod(jr - nside, 2);
   if( jr<nside ) { //then     ! north pole region
     nr = jr;
