Number
======
-.. cfunction:: json_t *json_integer(int value)
+ The JSON specification only contains one numeric type, "number". The C
+ programming language has distinct types for integer and floating-point
+ numbers, so for practical reasons Jansson also has distinct types for
+ the two. They are called "integer" and "real", respectively. For more
+ information, see :ref:`rfc-conformance`.
+
+.. ctype:: json_int_t
+
+ This is the C type that is used to store JSON integer values. It
+ represents the widest integer type available on your system. In
+ practice it's just a typedef of ``long long`` if your compiler
+ supports it, otherwise ``long``.
+
+ Usually, you can safely use plain ``int`` in place of
+ ``json_int_t``, and the implicit C integer conversion handles the
+ rest. Only when you know that you need the full 64-bit range, you
+ should use ``json_int_t`` explicitly.
+
+``JSON_INTEGER_IS_LONG_LONG``
+
+ This is a preprocessor variable that holds the value 1 if
+ :ctype:`json_int_t` is ``long long``, and 0 if it's ``long``. It
+ can be used as follows::
+
+ #if JSON_INTEGER_IS_LONG_LONG
+ /* Code specific for long long */
+ #else
+ /* Code specific for long */
+ #endif
+
+``JSON_INTEGER_FORMAT``
+
+ This is a macro that expands to a :cfunc:`printf()` conversion
+ specifier that corresponds to :ctype:`json_int_t`, without the
+ leading ``%`` sign, i.e. either ``"lld"`` or ``"ld"``. This macro
+ is required because the actual type of :ctype:`json_int_t` can be
+ either ``long`` or ``long long``, and :cfunc:`printf()` reuiqres
+ different length modifiers for the two.
+
+ Example::
+
+ json_int_t x = 123123123;
+ printf("x is %" JSON_INTEGER_FORMAT "\n", x);
+
+
+.. cfunction:: json_t *json_integer(json_int_t value)
.. refcounting:: new