Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

26.3.1

  • Loading branch information...
commit 70da431ad25209572361d97d0ca0b7d2ce7256ea 1 parent 38bc2c9
@falsetru authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 26/26.3.1.scm
View
13 26/26.3.1.scm
@@ -0,0 +1,13 @@
+(define (gcd-structural n m)
+ (local ((define (first-divisior-<= i)
+ (cond
+ [(= i 1) 1]
+ [else (cond
+ [(and (= (remainder n i) 0)
+ (= (remainder m i) 0))
+ i]
+ [else (first-divisior-<= (- i 1))])])))
+ (first-divisior-<= (min m n))))
+
+(time (gcd-structural 101135853 45014640))
+; cpu time: 684 real time: 685 gc time: 0
Please sign in to comment.
Something went wrong with that request. Please try again.