contrib & examples: update users of mnit implementations
[nit.git] / examples / draw_operation.nit
index cada831..a5ad1d5 100644 (file)
 # Draws an arithmetic operation to the terminal
 module draw_operation
 
+`{
+       #include <math.h>
+`}
+
 redef enum Int
        fun n_chars: Int `{
                int c;
-               if ( abs(recv) >= 10 )
-                       c = 1+(int)log10f( (float)abs(recv) );
+               if ( abs(self) >= 10 )
+                       c = 1+(int)log10f( (float)abs(self) );
                else
                        c = 1;
-               if ( recv < 0 ) c ++;
+               if ( self < 0 ) c ++;
                return c;
        `}
 end