failed attempts to intercept copy command when the cursor is in the empty text field...
[LeanCalc.git] / help / fprintf
1 NAME
2     fprintf - formatted print to a file
3
4 SYNOPSIS
5     fprintf(fd, fmt, x_1, x_2, ...)
6
7 TYPES
8     fd                  file
9     fmt                 string
10     x_1, x_2, ...       any
11
12     return              null
13
14 DESCRIPTION
15     This prints to the file fd exactly what would be printed to
16         the standard output by printf(fmt, x_1, x_2, ...).
17
18 EXAMPLE
19     > fprintf(files(1), "h=%d, i=%d\n", 2, 3);
20     h=2, i=3
21
22     > c = config("epsilon", 1e-6); c = config("display", 6);
23     > c = config("tilde", 1); c = config("outround", 0);
24     > c = config("fullzero", 0);
25     > fmt = "%f,%10f,%-10f,%10.4f,%.4f,%.f.\n";
26     > a = sqrt(3);
27     > fprintf(files(2), fmt,a,a,a,a,a,a);
28     1.732051,  1.732051,1.732051  ,   ~1.7320,~1.7320,~1.
29
30     > file = fopen("/tmp/foo", "w");
31     > mat A[4] = {sqrt(2), 3/7, "undefined", null()};
32     > fprintf(file, "%f%r",A,A);
33     > fclose(file);
34     > !cat /tmp/foo
35
36     mat [4] (4 elements, 4 nonzero):
37       [0] = 1.4142135623730950488
38       [1] = ~.42857142857142857142
39       [2] = "undefined"
40       [3] = NULL
41
42     mat [4] (4 elements, 4 nonzero):
43       [0] = 1767766952966368811/1250000000000000000
44       [1] = 3/7
45       [2] = "undefined"
46       [3] = NULL
47
48 LIMITS
49     The number of arguments of fprintf() is not to exceed 100.
50
51 LINK LIBRARY
52     none
53
54 SEE ALSO
55     printf, strprintf, print
56