etf.org/rfc/rfc4627.txt">JSON specification disallows special double values (NaN, Infinity, -Infinity). However,
Javascript specification (see section 4.3.20, 4.3.22, 4.3.23) allows these values as valid Javascript values. Moreover, most JavaScript engines will accept these special values in JSON without problem. So, at a practical level, it makes sense to accept these values as valid JSON even though JSON specification disallows them.
Gson always accepts these special values during deserialization. However, it outputs strictly compliant JSON. Hence, if it encounters a float value {@link Float#NaN}, {@link Float#POSITIVE_INFINITY}, {@link Float#NEGATIVE_INFINITY}, or a double value {@link Double#NaN}, {@link Double#POSITIVE_INFINITY}, {@link Double#NEGATIVE_INFINITY}, it will throw an {@link IllegalArgumentException}. This method provides a way to override the default behavior when you know that the JSON receiver will be able to handle these special values.
@return a reference to this {@code GsonBuilder} object to fulfill the "Builder" pattern
@since 1.3