2 fprintf - formatted print to a file
5 fprintf(fd, fmt, x_1, x_2, ...)
15 This prints to the file fd exactly what would be printed to
16 the standard output by printf(fmt, x_1, x_2, ...).
19 ; fprintf(files(1), "h=%d, i=%d\n", 2, 3);
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";
27 ; fprintf(files(2), fmt,a,a,a,a,a,a);
28 1.732051, 1.732051,1.732051 , ~1.7320,~1.7320,~1.
30 ; file = fopen("/tmp/foo", "w");
31 ; mat A[4] = {sqrt(2), 3/7, "undefined", null()};
32 ; fprintf(file, "%f%r",A,A);
36 mat [4] (4 elements, 4 nonzero):
37 [0] = 1.4142135623730950488
38 [1] = ~.42857142857142857142
42 mat [4] (4 elements, 4 nonzero):
43 [0] = 1767766952966368811/1250000000000000000
49 The number of arguments of fprintf() is not to exceed 1024.
55 printf, strprintf, print
57 ## Copyright (C) 1999-2006 Landon Curt Noll
59 ## Calc is open software; you can redistribute it and/or modify it under
60 ## the terms of the version 2.1 of the GNU Lesser General Public License
61 ## as published by the Free Software Foundation.
63 ## Calc is distributed in the hope that it will be useful, but WITHOUT
64 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
65 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
66 ## Public License for more details.
68 ## A copy of version 2.1 of the GNU Lesser General Public License is
69 ## distributed with calc under the filename COPYING-LGPL. You should have
70 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
71 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
73 ## @(#) $Revision: 30.1 $
74 ## @(#) $Id: fprintf,v 30.1 2007/03/16 11:10:42 chongo Exp $
75 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fprintf,v $
77 ## Under source code control: 1996/03/12 22:50:41
78 ## File existed as early as: 1996
80 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
81 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/