11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

182 • Chapter 4: Input and Output%[flags][width][.precision][modifiers]codeThe “%” symbol begins the format specification. One or more of the followingflags can optionally follow the “%” symbol:+ A signed numeric value is output with a leading “+” or “-” sign, asappropriate.- The output is left-justified instead of right-justified.blank A signed numeric value is output with either a leading “-” or aleading blank, depending on whether the value is negative or nonnegative.0 The output is padded on the left (between the sign and the first digit)with zeroes. If you also specify a “-”, the “0” is ignored.{} The braces enclose a set of detailed formatting options for printingan rtable. These are described in more detail in the help page?rtable_printf.The optional width indicates the minimum number of characters tooutput for this field. If the formatted value has fewer characters, Maplepads it with blanks on the left (or on the right, if you specify “-”).The optional precision specifies the number of digits that appear afterthe decimal point for floating-point formats, or the maximum field widthfor string formats.You can specify both width or precision as “*”, in which case Mapletakes the width or precision from the argument list. The width or precisionargument(s) must appear, in that order, before the argument that is beingoutput. A negative width argument is equivalent to the appearance of the“-” flag.The optional modifiers are used to indicate the type of the value tobe printed:l or L The letters l and L are supported for compatibility with the Cprintf function, and indicate that a "long int" or "long long" is tobe formatted. In Maple, these flags have no effect.zc or Z One of these flags can precede any of the numeric formats,namely d, o, x, e, f, or g, indicating that a complex value is to beformatted. Each of the real and imaginary parts of the complex valueare formatted using the specified format, with the z or Z elided. The

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!