From 1448ec8c3d9ea004061100f1042840e14ba16769 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Thu, 24 Jun 2010 18:07:00 +0000 Subject: patch mochijson2 to allow output of big integers not in float form (it stores them just fine) git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957656 13f79535-47bb-0310-9956-ffa450edef68 --- src/mochiweb/mochijson2.erl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/mochiweb/mochijson2.erl') diff --git a/src/mochiweb/mochijson2.erl b/src/mochiweb/mochijson2.erl index 66f68bf0..111c37bd 100644 --- a/src/mochiweb/mochijson2.erl +++ b/src/mochiweb/mochijson2.erl @@ -98,11 +98,8 @@ json_encode(false, _State) -> <<"false">>; json_encode(null, _State) -> <<"null">>; -json_encode(I, _State) when is_integer(I) andalso I >= -2147483648 andalso I =< 2147483647 -> - %% Anything outside of 32-bit integers should be encoded as a float - integer_to_list(I); json_encode(I, _State) when is_integer(I) -> - mochinum:digits(float(I)); + integer_to_list(I); json_encode(F, _State) when is_float(F) -> mochinum:digits(F); json_encode(S, State) when is_binary(S); is_atom(S) -> -- cgit v1.2.3