                           tick_interval,
                           use_endpoints = false)
 
-    else if log_interval < (tick_goal+1)/2 or explicit_ticks:
+    else if log_interval < (tick_goal+1)/2 or explicit_ticks
         # If there's enough space, try to put lines at the magic number multipliers
         # inside each power of ten
 
         # Try each interval to see how many ticks we get
-        for interval in magic_numbers:
+        for interval in magic_numbers
             ticklist = []
-            for exp in range(int(Math.floor(log_low)), int(Math.ceil(log_high))):
+            for exp in [Math.floor(log_low).,Math.ceil(log_high)]
                 for multiplier in linspace(interval, 10.0, round(10.0/interval),
-                                           endpoint=1):
-                    tick = 10**exp*multiplier
+                                           endpoint=1)
+                    tick = Math.exp(10, exp*multiplier)
                     if tick >= data_low and tick <= data_high:
                         ticklist.append(tick)
             if len(ticklist)<tick_goal+3 or explicit_ticks:

    # so we subtract a small, index dependent amount from each difference
    # to force correct ordering.
    sh    = shape( differences )
    small = 2.2e-16 * arange( sh[1] ) * arange( sh[0] )[:,newaxis]
    small = small[::-1,::-1] #reverse the order
    differences = differences - small

    # ? Numeric should allow keyword "axis" ? comment out for now

    specifies whether *end_point* is at the upper (True) or lower (false)
    end of the axis.
    """
    [quotient, remainder] = divmod( end_point, tick_interval )
    rem_p = remainder == 0.0
    tick_p = ((tick_interval - remainder) / tick_interval) < 0.00001
    if rem_p or tick_p
        return end_point

    c1 = (quotient + 1.0) * tick_interval
    c2 = quotient         * tick_interval
    if is_upper
        return max( c1, c2 )
    return min( c1, c2 )

