@@ -67,7 +67,7 @@ def main() -> int:
6767| `json_object_value(json)` | `byte* ` (JSON ) | pointer into value in `json` or NULL |
6868| `json_get(json, key)` | `byte* ` (JSON ) | pointer into value in `json` or NULL |
6969| `json_to_double(json)` | `double` | value in `json` or NaN |
70- | `json_to_string(json)` | `byte* ` (needs `free()` ) | string from `json` or NULL |
70+ | `json_to_string(json)` | `byte* ` (needs `free()` ) | new copy of string in `json` or NULL |
7171| `json_equals_string(json, s)` | `bool ` | `True ` if `json` points at `s` as a JSON string |
7272| `json_is_true(json)` | `bool ` | `True ` if `json` points at a JSON `true` |
7373| `json_is_false(json)` | `bool ` | `True ` if `json` points at a JSON `false` |
@@ -137,6 +137,7 @@ Once you have found the value you want, you can use these functions to parse it:
137137 `json_is_null(" null" )` returns `True ` but `json_is_null(NULL )` returns `False ` .
138138- `json_to_double(json: byte* ) -> double` gets a `double` value from a JSON number.
139139 If `json` doesn' t start with a JSON number, this function returns NaN.
140+ To check for NaN, you can use the `isnan()` function in [stdlib/ math.jou](../ stdlib/ math.jou).
140141 See also [the notes about numbers below](# notes-about-numbers).
141142- `json_to_string(json: byte* ) -> byte* ` parses a string from JSON
142143 and returns it as `\0`-terminated UTF-8 (that is, a typical Jou string).
@@ -300,7 +301,8 @@ and `atof()` does not understand the `.34` part of the number because it's expec
300301Some libraries (e.g. Gtk) call `setlocale()` automatically,
301302and that can also cause this problem.
302303Please [create an issue on GitHub](https:// github.com/ Akuli/ jou/ issues/ new) if you run into this.
303- There is a similar problem with [building JSON ](json- building.md# notes-about-numbers).
304+ There is a similar problem with [building JSON ](json- building.md# notes-about-numbers)
305+ and [parsing TOML ](toml.md# notes-about-numbers).
304306
305307
306308# # Notes about strings
0 commit comments