Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / printf.1
blob113b72d84dfa13775bd3ff7d7c11edd3dbf61205
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright 1992, X/Open Company Limited All Rights Reserved
44 .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
45 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
46 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
47 .\"
48 .TH PRINTF 1 "May 11, 2014"
49 .SH NAME
50 printf \- write formatted output
51 .SH SYNOPSIS
52 .SS "/usr/bin/printf"
53 .LP
54 .nf
55 \fBprintf\fR \fIformat\fR [\fIargument\fR]...
56 .fi
58 .SS "ksh93"
59 .LP
60 .nf
61 \fBprintf\fR \fIformat\fR [\fIstring\fR...]
62 .fi
64 .SH DESCRIPTION
65 .SS "/usr/bin/printf"
66 .sp
67 .LP
68 The \fBprintf\fR utility writes each string operand to standard output using
69 \fIformat\fR to control the output format.
70 .SH OPERANDS
71 .SS "/usr/bin/printf"
72 .sp
73 .LP
74 The following operands are supported by \fB/usr/bin/printf\fR:
75 .sp
76 .ne 2
77 .na
78 \fB\fIformat\fR\fR
79 .ad
80 .RS 12n
81 A string describing the format to use to write the remaining operands. The
82 \fIformat\fR operand is used as the \fIformat\fR string described on the
83 \fBformats\fR(5) manual page, with the following exceptions:
84 .RS +4
85 .TP
86 .ie t \(bu
87 .el o
88 A \fBSPACE\fR character in the format string, in any context other than a flag
89 of a conversion specification, is treated as an ordinary character that is
90 copied to the output.
91 .RE
92 .RS +4
93 .TP
94 .ie t \(bu
95 .el o
96 A character in the format string is treated as a character, not as a
97 \fBSPACE\fR character.
98 .RE
99 .RS +4
101 .ie t \(bu
102 .el o
103 In addition to the escape sequences described on the \fBformats\fR(5) manual
104 page (\fB\e\e\fR, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR, \fB\en\fR, \fB\er\fR,
105 \fB\et\fR, \fB\ev\fR), \fB\e\fR\fIddd\fR, where \fIddd\fR is a one-, two- or
106 three-digit octal number, is written as a byte with the numeric value specified
107 by the octal number.
109 .RS +4
111 .ie t \(bu
112 .el o
113 The program does not precede or follow output from the \fBd\fR or \fBu\fR
114 conversion specifications with blank characters not specified by the
115 \fIformat\fR operand.
117 .RS +4
119 .ie t \(bu
120 .el o
121 The program does not precede output from the \fBo\fR conversion specification
122 with zeros not specified by the \fIformat\fR operand.
124 .RS +4
126 .ie t \(bu
127 .el o
128 The argument used for the conversion character (or width or precision
129 parameters, see below) may be taken from the \fIn\fRnth argument instead
130 of the next unused argument, by specifying \fIn\fR\fB$\fR immediately following
131 the \fB%\fR character, or the \fB*\fR character (for width or precision
132 arguments).
133 If \fIn\fR\fB$\fR appears in any conversions in the format string,
134 then it must be used for all conversions, including any variable width or
135 precision specifiers.
137 .RS +4
139 .ie t \(bu
140 .el o
141 The special character \fB*\fR may be used instead of a string of decimal digits
142 to indicate a minimum field width or a precision.  In this case the next
143 available argument is used (or the \fIn\fRth if the form \fIn\fR\fB$\fR is
144 used), treating its value as a decimal string.
146 .RS +4
148 .ie t \(bu
149 .el o
150 An additional conversion character, \fBb\fR, is supported as follows. The
151 argument is taken to be a string that can contain backslash-escape sequences.
152 The following backslash-escape sequences are supported:
153 .RS +4
155 .ie t \(bu
156 .el o
157 the escape sequences listed on the \fBformats\fR(5) manual page (\fB\e\e\fR,
158 \fB\ea\fR, \fB\eb\fR, \fB\ef\fR, \fB\en\fR, \fB\er\fR, \fB\et\fR, \fB\ev\fR),
159 which are converted to the characters they represent
161 .RS +4
163 .ie t \(bu
164 .el o
165 \fB\e0\fR\fIddd\fR, where \fIddd\fR is a zero-, one-, two- or three-digit octal
166 number that is converted to a byte with the numeric value specified by the
167 octal number
169 .RS +4
171 .ie t \(bu
172 .el o
173 \fB\ec\fR, which is written and causes \fBprintf\fR to ignore any remaining
174 characters in the string operand containing it, any remaining string operands
175 and any additional characters in the \fIformat\fR operand.
178 The interpretation of a backslash followed by any other sequence of characters
179 is unspecified.
181 Bytes from the converted string are written until the end of the string or the
182 number of bytes indicated by the precision specification is reached. If the
183 precision is omitted, it is taken to be infinite, so all bytes up to the end of
184 the converted string are written. For each specification that consumes an
185 argument, the next argument operand is evaluated and converted to the
186 appropriate type for the conversion as specified below. The \fIformat\fR
187 operand is reused as often as necessary to satisfy the argument operands. Any
188 extra \fBc\fR or \fBs\fR conversion specifications are evaluated as if a null
189 string argument were supplied; other extra conversion specifications are
190 evaluated as if a zero argument were supplied.
192 When there are more argument operands than format specifiers, and the
193 format includes \fIn\fR\fB$\fR position indicators, then the format is
194 reprocessed from the beginning as above, but with the argument list starting
195 from the next argument after the highest \fIn\fRth argument previously
196 encountered.
198 If the \fIformat\fR operand
199 contains no conversion specifications and \fIargument\fR operands are present,
200 the results are unspecified. If a character sequence in the \fIformat\fR
201 operand begins with a \fB%\fR character, but does not form a valid conversion
202 specification, the behavior is unspecified.
206 .ne 2
208 \fB\fIargument\fR\fR
210 .RS 12n
211 The strings to be written to standard output, under the control of
212 \fBformat\fR. The \fIargument\fR operands are treated as strings if the
213 corresponding conversion character is \fBb\fR, \fBc\fR or \fBs\fR. Otherwise,
214 it is evaluated as a C constant, as described by the ISO C standard, with the
215 following extensions:
216 .RS +4
218 .ie t \(bu
219 .el o
220 A leading plus or minus sign is allowed.
222 .RS +4
224 .ie t \(bu
225 .el o
226 If the leading character is a single- or double-quote, the value is the numeric
227 value in the underlying codeset of the character following the single- or
228 double-quote.
230 If an argument operand cannot be completely converted into an internal value
231 appropriate to the corresponding conversion specification, a diagnostic message
232 is written to standard error and the utility does not exit with a zero exit
233 status, but continues processing any remaining operands and writes the value
234 accumulated at the time the error was detected to standard output.
237 .SS "ksh93"
240 The \fIformat\fR operands support the full range of ANSI C/C99/XPG6 formatting
241 specifiers as well as additional specifiers:
243 .ne 2
245 \fB\fB%b\fR\fR
247 .RS 6n
248 Each character in the string operand is processed specially, as follows:
250 .ne 2
252 \fB\fB\ea\fR\fR
254 .RS 8n
255 Alert character.
259 .ne 2
261 \fB\fB\eb\fR\fR
263 .RS 8n
264 Backspace character.
268 .ne 2
270 \fB\fB\ec\fR\fR
272 .RS 8n
273 Terminate output without appending NEWLINE. The remaining string operands are
274 ignored.
278 .ne 2
280 \fB\fB\eE\fR\fR
282 .RS 8n
283 Escape character (\fBASCII\fR octal \fB033\fR).
287 .ne 2
289 \fB\fB\ef\fR\fR
291 .RS 8n
292 FORM FEED character.
296 .ne 2
298 \fB\fB\en\fR\fR
300 .RS 8n
301 NEWLINE character.
305 .ne 2
307 \fB\fB\et\fR\fR
309 .RS 8n
310 TAB character.
314 .ne 2
316 \fB\fB\ev\fR\fR
318 .RS 8n
319 Vertical tab character.
323 .ne 2
325 \fB\fB\e\e\fR\fR
327 .RS 8n
328 Backslash character.
332 .ne 2
334 \fB\fB\e0\fR\fIx\fR\fR
336 .RS 8n
337 The 8-bit character whose \fBASCII\fR code is the \fB1\fR-, \fB2\fR-, or
338 \fB3\fR-digit octal number \fIx\fR.
344 .ne 2
346 \fB\fB%B\fR\fR
348 .RS 6n
349 Treat the argument as a variable name and output the value without converting
350 it to a string. This is most useful for variables of type \fB-b\fR.
354 .ne 2
356 \fB\fB%H\fR\fR
358 .RS 6n
359 Output string with characters \fB<\fR, \fB&\fR, \fB>\fR, \fB"\fR, and
360 non-printable characters, properly escaped for use in HTML and XML documents.
364 .ne 2
366 \fB\fB%P\fR\fR
368 .RS 6n
369 Treat \fIstring\fR as an extended regular expression and convert it to a shell
370 pattern.
374 .ne 2
376 \fB\fB%q\fR\fR
378 .RS 6n
379 Output \fIstring\fR quoted in a manner that it can be read in by the shell to
380 get back the same string. However, empty strings resulting from missing string
381 operands are not quoted.
385 .ne 2
387 \fB\fB%R\fR\fR
389 .RS 6n
390 Treat \fIstring\fR as an shell pattern expression and convert it to an extended
391 regular expression.
395 .ne 2
397 \fB\fB%T\fR\fR
399 .RS 6n
400 Treat \fIstring\fR as a date/time string and format it. The \fBT\fR can be
401 preceded by (\fIdformat\fR), where \fIdformat\fR is a date format as defined by
402 the \fBdate\fR(1) command.
406 .ne 2
408 \fB\fB%Z\fR\fR
410 .RS 6n
411 Output a byte whose value is \fB0\fR.
416 When performing conversions of \fIstring\fR to satisfy a numeric format
417 specifier, if the first character of \fIstring\fR is \fB"or'\fR, the value is
418 the numeric value in the underlying code set of the character following the
419 \fB"or'\fR. Otherwise, \fIstring\fR is treated like a shell arithmetic
420 expression and evaluated.
423 If a \fIstring\fR operand cannot be completely converted into a value
424 appropriate for that format specifier, an error occurs, but remaining
425 \fIstring\fR operands continue to be processed.
428 In addition to the format specifier extensions, the following extensions of
429 ANSI C/C99/XPG6 are permitted in format specifiers:
430 .RS +4
432 .ie t \(bu
433 .el o
434 The escape sequences \fB\eE\fR and \fB\ee\fR expand to the escape character
435 which is octal 033 in ASCII.
437 .RS +4
439 .ie t \(bu
440 .el o
441 The escape sequence \fB\ecx\fR expands to CTRL-x.
443 .RS +4
445 .ie t \(bu
446 .el o
447 The escape sequence \fB\eC[.\fR\fIname\fR\fB\&.]\fR expands to the collating
448 element \fIname\fR.
450 .RS +4
452 .ie t \(bu
453 .el o
454 The escape sequence \fB\ex{hex}\fR expands to the character corresponding to
455 the hexadecimal value \fBhex\fR.
457 .RS +4
459 .ie t \(bu
460 .el o
461 The format modifier flag = can be used to center a field to a specified width.
462 When the output is a terminal, the character width is used rather than the
463 number of bytes.
465 .RS +4
467 .ie t \(bu
468 .el o
469 Each of the integral format specifiers can have a third modifier after width
470 and precision that specifies the base of the conversion from 2 to 64. In this
471 case, the \fB#\fR modifier causes \fIbase\fR\fB#\fR to be prepended to the
472 value.
474 .RS +4
476 .ie t \(bu
477 .el o
478 The \fB#\fR modifier can be used with the \fBd\fR specifier when no base is
479 specified to cause the output to be written in units of 1000 with a suffix of
480 one of \fBk M G T P E\fR.
482 .RS +4
484 .ie t \(bu
485 .el o
486 The \fB#\fR modifier can be used with the \fBi\fR specifier to cause the output
487 to be written in units of \fB1024\fR with a suffix of one of \fBKi Mi Gi Ti Pi
488 Ei\fR.
492 If there are more \fIstring\fR operands than format specifiers, the format
493 string is reprocessed from the beginning. If there are fewer \fIstring\fR
494 operands than format specifiers, then \fIstring\fR specifiers are treated as if
495 empty strings were supplied, numeric conversions are treated as if \fB0\fR was
496 supplied, and time conversions are treated as if \fBnow\fR was supplied.
499 When there are more argument operands than format specifiers, and the
500 format includes \fIn\fR\fB$\fR position indicators, then the format is
501 reprocessed from the beginning as above, but with the argument list starting
502 from the next argument after the highest \fIn\fRth argument previously
503 encountered.
506 \fB/usr/bin/printf\fR is equivalent to \fBksh93\fR's \fBprintf\fR built-in and
507 \fBprint -f\fR, which allows additional options to be specified.
508 .SH USAGE
509 .SS "/usr/bin/printf"
512 The \fBprintf\fR utility, like the \fBprintf\fR(3C) function on which it is
513 based, makes no special provision for dealing with multi-byte characters when
514 using the \fB%c\fR conversion specification. Applications should be extremely
515 cautious using either of these features when there are multi-byte characters in
516 the character set.
519 The \fB%b\fR conversion specification is not part of the ISO C standard; it has
520 been added here as a portable way to process backslash escapes expanded in
521 string operands as provided by the \fBecho\fR utility. See also the USAGE
522 section of the \fBecho\fR(1) manual page for ways to use \fBprintf\fR as a
523 replacement for all of the traditional versions of the \fBecho\fR utility.
526 If an argument cannot be parsed correctly for the corresponding conversion
527 specification, the \fBprintf\fR utility reports an error. Thus, overflow and
528 extraneous characters at the end of an argument being used for a numeric
529 conversion are to be reported as errors.
532 It is not considered an error if an argument operand is not completely used for
533 a \fBc\fR or \fBs\fR conversion or if a string operand's first or second
534 character is used to get the numeric value of a character.
535 .SH EXAMPLES
536 .SS "/usr/bin/printf"
538 \fBExample 1 \fRPrinting a Series of Prompts
541 The following example alerts the user, then prints and reads a series of
542 prompts:
545 .in +2
547 example% \fBprintf "\eaPlease fill in the following: \enName: "
548 read name
549 printf "Phone number: "
550 read phone\fR
552 .in -2
556 \fBExample 2 \fRPrinting a Table of Calculations
559 The following example prints a table of calculations. It reads out a list of
560 right and wrong answers from a file, calculates the percentage correctly, and
561 prints them out. The numbers are right-justified and separated by a single tab
562 character. The percentage is written to one decimal place of accuracy:
565 .in +2
567 example% \fBwhile read right wrong ; do
568    percent=$(echo "scale=1;($right*100)/($right+$wrong)" | bc)
569    printf "%2d right\et%2d wrong\et(%s%%)\en" \e
570            $right $wrong $percent
571 done < database_file\fR
573 .in -2
577 \fBExample 3 \fRPrinting number strings
580 The command:
583 .in +2
585 example% \fBprintf "%5d%4d\en" 1 21 321 4321 54321\fR
587 .in -2
592 produces:
595 .in +2
597     1  21
598   3214321
599 54321   0
601 .in -2
606 The \fIformat\fR operand is used three times to print all of the given strings
607 and that a \fB0\fR was supplied by \fBprintf\fR to satisfy the last \fB%4d\fR
608 conversion specification.
611 \fBExample 4 \fRTabulating Conversion Errors
614 The following example tabulates conversion errors.
618 The \fBprintf\fR utility tells the user when conversion errors are detected
619 while producing numeric output. These results would be expected on an
620 implementation with 32-bit twos-complement integers when \fB%d\fR is specified
621 as the \fIformat\fR operand:
627 box;
628 c c c
629 l l l .
630 Arguments       Standard        Diagnostic
631 5a      5       printf: 5a not completely converted
632 9999999999      2147483647      printf: 9999999999: Results too large
633 -9999999999     -2147483648     printf: -9999999999: Results too large
634 ABC     0       printf: ABC expected numeric value
639 The value shown on standard output is what would be expected as the return
640 value from the function \fBstrtol\fR(3C). A similar correspondence exists
641 between \fB%u\fR and \fBstrtoul\fR(3C), and \fB%e\fR, \fB%f\fR and \fB%g\fR and
642 \fBstrtod\fR(3C).
645 \fBExample 5 \fRPrinting Output for a Specific Locale
648 The following example prints output for a specific locale. In a locale using
649 the ISO/IEC 646:1991 standard as the underlying codeset, the command:
652 .in +2
654 example% \fBprintf "%d\en" 3 +3 -3 \e'3 \e"+3 "'-3"\fR
656 .in -2
661 produces:
667 box;
668 l l
669 l l .
670 \fB3\fR Numeric value of constant 3
671 \fB3\fR Numeric value of constant 3
672 \fB\(mi3\fR     Numeric value of constant \(mi3
673 \fB51\fR        T{
674 Numeric value of the character `3' in the ISO/IEC 646:1991 standard codeset
676 \fB43\fR        T{
677 Numeric value of the character `+' in the ISO/IEC 646:1991 standard codeset
679 \fB45\fR        T{
680 Numeric value of the character `\(mi' in the SO/IEC 646:1991 standard codeset
686 In a locale with multi-byte characters, the value of a character is intended to
687 be the value of the equivalent of the \fBwchar_t\fR representation of the
688 character.
692 If an argument operand cannot be completely converted into an internal value
693 appropriate to the corresponding conversion specification, a diagnostic message
694 is written to standard error and the utility does exit with a zero exit status,
695 but continues processing any remaining operands and writes the value
696 accumulated at the time the error was detected to standard output.
699 \fBExample 6 \fRAlternative floating point representation 1
702 The \fBprintf\fR utility supports an alternative floating point representation
703 (see \fBprintf\fR(3C) entry for the "\fB%a\fR"/"\fB%A\fR"), which allows the
704 output of floating-point values in a format that avoids the usual base16 to
705 base10 rounding errors.
708 .in +2
710 example% printf "%a\en" 2 3.1 NaN
712 .in -2
717 produces:
720 .in +2
722 0x1.0000000000000000000000000000p+01
723 0x1.8ccccccccccccccccccccccccccdp+01
726 .in -2
730 \fBExample 7 \fRAlternative floating point representation 2
733 The following example shows two different representations of the same
734 floating-point value.
737 .in +2
739 example% x=2 ; printf "%f == %a\en" x x
741 .in -2
746 produces:
749 .in +2
751 2.000000 == 0x1.0000000000000000000000000000p+01
753 .in -2
757 \fBExample 8 \fROutput of unicode values
760 The following command will print the EURO unicode symbol (code-point 0x20ac).
763 .in +2
765 example% LC_ALL=en_US.UTF-8 printf "\u[20ac]\en"
767 .in -2
772 produces:
775 .in +2
777 <euro>
779 .in -2
784 where "<euro>" represents the EURO currency symbol character.
787 \fBExample 9 \fRConvert unicode character to unicode code-point value
790 The following command will print the hexadecimal value of a given character.
793 .in +2
795 example% export LC_ALL=en_US.UTF-8
796 example% printf "%x\en" "'<euro>"
798 .in -2
803 where "<euro>" represents the EURO currency symbol character (code-point
804 0x20ac).
808 produces:
811 .in +2
813 20ac
815 .in -2
819 \fBExample 10 \fRPrint the numeric value of an ASCII character
821 .in +2
823 example% printf "%d\en" "'A"
825 .in -2
830 produces:
833 .in +2
837 .in -2
841 \fBExample 11 \fRPrint the language-independent date and time format
844 To print the language-independent date and time format, the following statement
845 could be used:
848 .in +2
850 example% printf "format" weekday month day hour min
852 .in -2
857 For example,
860 .in +2
862 $ printf format "Sunday" "July" 3 10 2
864 .in -2
869 For American usage, format could be the string:
872 .in +2
874 "%s, %s %d, %d:%.2d\en"
876 .in -2
881 producing the message:
884 .in +2
886 Sunday, July 3, 10:02
888 .in -2
893 Whereas for EU usage, format could be the string:
896 .in +2
898 "%1$s, %3$d. %2$s, %4$d:%5$.2d\en"
900 .in -2
905 Note that the '$' characters must be properly escaped, such as
908 .in +2
910 "%1\e$s, %3\e$d. %2\e$s, %4\e$d:%5\e$.2d\en" in this case
912 .in -2
917 producing the message:
920 .in +2
922 Sunday, 3. July, 10:02
924 .in -2
927 .SH ENVIRONMENT VARIABLES
930 See \fBenviron\fR(5) for descriptions of the following environment variables
931 that affect the execution of \fBprintf\fR: \fBLANG\fR, \fBLC_ALL\fR,
932 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_NUMERIC\fR, and \fBNLSPATH\fR.
933 .SH EXIT STATUS
936 The following exit values are returned:
938 .ne 2
940 \fB\fB0\fR\fR
942 .RS 6n
943 Successful completion.
947 .ne 2
949 \fB\fB>0\fR\fR
951 .RS 6n
952 An error occurred.
955 .SH ATTRIBUTES
958 See \fBattributes\fR(5) for descriptions of the following attributes:
959 .SS "/usr/bin/printf"
964 box;
965 c | c
966 l | l .
967 ATTRIBUTE TYPE  ATTRIBUTE VALUE
969 CSI     Enabled
971 Interface Stability     Committed
973 Standard        See \fBstandards\fR(5).
976 .SS "ksh93"
981 box;
982 c | c
983 l | l .
984 ATTRIBUTE TYPE  ATTRIBUTE VALUE
986 Interface Stability     Uncommitted
989 .SH SEE ALSO
992 \fBawk\fR(1), \fBbc\fR(1), \fBdate\fR(1), \fBecho\fR(1), \fBksh93\fR(1),
993 \fBprintf\fR(3C), \fBstrtod\fR(3C), \fBstrtol\fR(3C), \fBstrtoul\fR(3C),
994 \fBattributes\fR(5), \fBenviron\fR(5), \fBformats\fR(5), \fBstandards\fR(5)
995 .SH NOTES
998 Using format specifiers (characters following '%') which are not listed in the
999 \fBprintf\fR(3C) or this manual page will result in undefined behavior.
1002 Using escape sequences (the character following a backslash ('\e')) which are
1003 not listed in the \fBprintf\fR(3C) or this manual page will result in undefined
1004 behavior.
1007 Floating-point values follow C99, XPG6 and IEEE 754 standard behavior and can
1008 handle values the same way as the platform's |\fBlong double\fR| datatype.
1011 Floating-point values handle the sign separately which allows signs for values
1012 like NaN (for example, -nan), Infinite (for example, -inf) and zero (for
1013 example, -0.0).