From 9e55951ed3a1d44f2e06295140cb4117c41ff67b Mon Sep 17 00:00:00 2001 From: Alexander Weiher Date: Thu, 27 Nov 2014 16:37:41 +0100 Subject: [PATCH] [Issue 68] add test to check for floating point rounding errors --- tests/draft4/multipleOf.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/draft4/multipleOf.json b/tests/draft4/multipleOf.json index ca3b7618..07d0ad49 100644 --- a/tests/draft4/multipleOf.json +++ b/tests/draft4/multipleOf.json @@ -56,5 +56,21 @@ "valid": false } ] + }, + { + "description": "not affected by floating point rounding error", + "schema": {"multipleOf": 0.01}, + "tests": [ + { + "description": "0.02 is multiple of 0.01", + "data": 0.02, + "valid": true + }, + { + "description": "6.67 is multiple of 0.01", + "data": 6.67, + "valid": true + } + ] } ]