Welcome to the CHICKEN Scheme pasting service

Ugarit divide by zero added by Kooda on Wed Aug 12 16:41:13 2015

--- ugarit.scm
+++ ugarit.scm
@@ -38,13 +38,15 @@
     (sprintf "~AKiB" (inexact->exact (round (/ b 1024)))))
    (else
     (sprintf "~AB" b))))
 
 (define (percent a b)
-  (inexact->exact
-   (round
-    (* 100 (/ a b)))))
+  (if (zero? b)
+      100
+      (inexact->exact
+       (round
+        (* 100 (/ a b))))))
 
 (define progress-callback
   (let ((cpath #f)
         (csize #f)
         (bytes #f)

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which egg provides `take-right'?
Visually impaired? Let me spell it for you (wav file) download WAV