Fix bug in random-int

The `random-int` function in both `number-io` and `smallest` subtracted a floating point value (`100.0`), which means they were both _actually_ returning a float instead of an int.

This removes both of the ".0"s so that they return integers as advertised.
This commit is contained in:
Nic McPhee 2020-11-10 16:59:32 -06:00
parent db085080b3
commit bfa557c6a1
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@
(defn random-float [] (- (* (rand) 200) 100.0))
; Random integer between -100 and 100
(defn random-int [] (- (rand-int 201) 100.0))
(defn random-int [] (- (rand-int 201) 100))
(def instructions
(utils/not-lazy

View File

@ -38,7 +38,7 @@
;; =============================================================================
; Random integer between -100 and 100
(defn random-int [] (- (rand-int 201) 100.0))
(defn random-int [] (- (rand-int 201) 100))
(def instructions
(utils/not-lazy