From 2e6ee5ddea380af7e6873651f98e4285f2b7aecb Mon Sep 17 00:00:00 2001 From: Colin Jones Date: Fri, 29 Oct 2010 10:18:09 -0500 Subject: [PATCH] Include new equality rules for floats. --- src/koans/equalities.clj | 11 ++++++++++- src/path_to_answer_sheet.clj | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/koans/equalities.clj b/src/koans/equalities.clj index cc60740..9285621 100644 --- a/src/koans/equalities.clj +++ b/src/koans/equalities.clj @@ -6,4 +6,13 @@ (= __ (+ 1 1)) "You can test equality of many things" - (= (+ 3 4) __ (+ 2 __))) + (= (+ 3 4) __ (+ 2 __)) + + "Some things may appear different, but be the same" + (= 2 2/1 __) + + "You cannot generally float to heavens of integers" + (= __ (= 2 2.0)) + + "But a looser equality is also possible" + (== 2.0 2 __)) diff --git a/src/path_to_answer_sheet.clj b/src/path_to_answer_sheet.clj index 3028fdc..00b13da 100644 --- a/src/path_to_answer_sheet.clj +++ b/src/path_to_answer_sheet.clj @@ -7,7 +7,10 @@ {"equalities" {"__" [true 2 7 - 5]} + 5 + 4/2 + false + 6/3]} "lists" {"__" ["1 2 3 4 5" 1 [2 3 4 5]