1explain_strtold_or_die(3) Library Functions Manual explain_strtold_or_die(3)
2
3
4
6 explain_strtold_or_die - convert string to number and report errors
7
9 #include <libexplain/strtold.h>
10 long double explain_strtold_or_die(const char *nptr, char **endptr);
11 long double explain_strtold_on_error(const char *nptr, char **endptr))
12
14 The explain_strtold_or_die function is used to call the strtold(3) sys‐
15 tem call. On failure an explanation will be printed to stderr, obtained
16 from the explain_strtold(3) function, and then the process terminates
17 by calling exit(EXIT_FAILURE).
18
19 The explain_strtold_on_error function is used to call the strtold(3)
20 system call. On failure an explanation will be printed to stderr,
21 obtained from the explain_strtold(3) function, but still returns to the
22 caller.
23
24 nptr The nptr, exactly as to be passed to the strtold(3) system
25 call.
26
27 endptr The endptr, exactly as to be passed to the strtold(3) system
28 call.
29
31 The explain_strtold_or_die function only returns on success, see str‐
32 told(3) for more information. On failure, prints an explanation and
33 exits, it does not return.
34
35 The explain_strtold_on_error function always returns the value return
36 by the wrapped strtold(3) system call.
37
39 The explain_strtold_or_die function is intended to be used in a fashion
40 similar to the following example:
41 long double result = explain_strtold_or_die(nptr, endptr);
42
44 strtold(3)
45 convert ASCII string to floating‐point number
46
47 explain_strtold(3)
48 explain strtold(3) errors
49
50 exit(2) terminate the calling process
51
53 libexplain version 0.40
54 Copyright (C) 2009 Peter Miller
55
56
57
58 explain_strtold_or_die(3)