php fmod小数位数_wprintf_s

格式-指向以空字符结尾的宽字符串的指针,指定如何解释数据。格式字符串由普通的宽字符(%除外)组成,它们被不变地复制到输出流中,以及转换规范。每个转换规范具有以下格式:介绍%字符(可选)一个或多个标志,用于修改转换的行为: - :转换结果在字段内左对齐(默认情况下,它是右对齐的)+ :带符号转换的符号总是作为转换结果的前缀(默认情况下,只有当结果为负时,结果才以负值开头)space:如果带符号转换的结果不是以符号字符开头,或者是空的,空间是预先考虑的结果。如果存在+标志,则忽略它。#:执行转换的替代形式。请参阅下表以了解确切的效果,否则行为未定义。0:对于整数和浮点数转换,前导零用于填充字段而不是空格字符。对于整数,如果明确指定了精度,它将被忽略。对于使用此标志的其他转换会导致未定义的行为。如果 - 标志存在,它将被忽略。(可选)整数值或*指定最小字段宽度。如果需要,结果会填充空格字符(默认情况下),右侧对齐时填充空白字符,左侧填充右侧填充。在使用*的情况下,宽度由类型为int的附加参数指定。如果参数的值是负值,那么结果是指定 - 标志和正字段宽度。(注意:这是最小宽度:该值从不被截断。)(可选)。后跟整数或*,或者两者都不指定转换的精度。在使用*的情况下,精度由类型为int的附加参数指定。如果这个参数的值是负数,它将被忽略。如果既不使用数字也不使用*,则精度取为零。请参阅下表以了解精确度的确切影响。(可选)长度修饰符,用于指定参数转换格式说明符的大小以下格式说明符可用:转换说明符说明参数类型长度修饰符hh(C99)。h(无)ll(C99)。j(C99)。z(C99)。t(C99)。L%写文字%。完整的转换规范必须是%%。不适用不适用不适用不适用不适用不适用不适用不适用不适用单个字符。该参数首先转换为wchar_t,就好像通过调用btowc一样。如果使用l修饰符,则首先将wint_t参数转换为wchar_t。N / AN / A int wint_t N / AN / AN / AN / AN / A s写入字符串参数必须是一个指向包含多字节字符序列的字符数组的初始元素的指针,该字符序列从初始转换状态开始,被转换为宽字符数组,就像通过调用mbrtowc以零初始化转换状态一样。Precision指定要写入的最大宽字符数。如果未指定Precision,则将每个宽字符写入并不包括第一个空终止符。如果使用l说明符,参数必须是指向wchar_t数组的初始元素的指针。N / AN / A char * wchar_t * N / AN / AN / AN / AN / A di将有符号整数转换为十进制表示形式-dddd。精度指定出现的最小位数。默认精度为1.如果转换值和精度均为0,则转换不会生成任何字符。signed char short int long long long intmax_t signed size_t ptrdiff_t不适用o将无符号整数转换为八进制表示oooo。精度指定出现的最小位数。默认精度为1.如果转换值和精度均为0,则转换不会生成任何字符。在替代实现中,如果需要,可以增加精度以写入一个前导零。在这种情况下,如果转换值和精度均为0,则写入单个0。unsigned char unsigned short unsigned int unsigned long unsigned long long uintmax_t size_t ptrdiff_t的无符号版本不适用x X将无符号整数转换为十六进制表示形式hhhh。对于x转换字母abcdef被使用。对于X转换字母使用ABCDEF。精度指定出现的最小位数。默认精度为1.如果转换值和精度均为0,则转换不会生成任何字符。在替代实现中,如果转换后的值为非零值,则0x或0X将作为结果的前缀。不适用u将无符号整数转换为十进制表示形式dddd。精度指定出现的最小位数。默认精度为1。如果转换值和精度均为0,则转换不会生成字符。N / A f F将浮点数转换为样式-ddd.ddd中的十进制表示法。精度指定小数点后面出现的最小位数。默认精度为6.在替代实现中,即使没有数字跟随,小数点字符也会被写入。对于无限和非数字转换风格,请参阅注释。N / AN / A double double(C99)N / AN / AN / AN / A long double e E将浮点数转换为十进制指数表示法。对于e转换样式,使用-d.ddde±dd。对于E转换样式,使用-d.dddE±dd。指数至少包含两位数字,只有在必要时才使用更多数字。如果该值为0,则指数也为0。精度指定小数点后面出现的最小位数。默认精度为6.在替代实现中,即使没有数字跟随,小数点字符也会被写入。对于无限和非数字转换风格,请参阅注释。不适用不适用不适用不适用不适用不适用(C99)。将浮点数转换为十六进制指数表示法。对于转换类型,使用-0xh.hhhp±d。对于A转换样式,使用-0Xh.hhhP±d。如果参数不是标准化的浮点值,则第一个十六进制数字为0。如果该值为0,则指数也为0。精度指定小数点后面出现的最小位数。默认精度足以精确表示值。在替代实现中,即使没有数字跟随,小数点字符也会被写入。对于无限和非数字转换风格,请参阅注释。不可用/不可用/不可用/不可用/ g G根据值和精度将浮点数转换为十进制或十进制指数符号。对于使用样式e或f的g转换样式转换将被执行。对于G转换样式,将使用样式E或F进行转换。假设P等于非零的精度,如果未指定精度,则等于6;如果精度为0,则等于1。然后,如果具有样式E的转换将具有X的指数:如果P> X≥-4,则转换具有样式f或F和精度P-1-X。否则,转换具有样式e或E以及精度P  -  1。除非请求替代表示,否则尾随零将被删除,如果没有剩余小数部分,小数点字符也会被删除。对于无限和非数字转换风格,请参阅注释。不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用不适用 结果写入参数指向的值。规范可能不包含任何标志,字段宽度或精度。signed char * short * int * long * long long * intmax_t * signed size_t * ptrdiff_t * N / A p写一个实现定义的字符序列来定义一个指针。不适用不适用不适用不适用不适用不适用不适用浮点转换函数将无穷大转换为inf或无穷大。使用哪一个是实现定义的。非数字转换为南或南(char_sequence)。使用哪一个是实现定义的。转换F,E,G,A代替输出INF,INFINITY,NAN。尽管%c需要int参数,但因为在调用可变参数函数时发生整数提升,所以传递char是安全的。固定宽度字符类型(int8_t等)的正确转换规范在标头中定义(尽管PRIdMAX,PRIuMAX等与%jd,%ju等同义)。内存写入转换说明符%n是格式字符串依赖用户输入并且不受边界检查的printf_s系列函数支持的安全漏洞的常见目标。每个转换说明符的操作之后都有一个序列点; 这允许将多个%n结果存储在相同的变量中,或者,作为边缘情况,在相同的调用中打印由早先的%n修改的字符串。如果转换规范无效,则行为未定义。Conversion specifierExplanationArgument typelength modifierhh (C99).h(none)lll (C99).j (C99).z (C99).t (C99).L%writes literal %. The full conversion specification must be %%.N/AN/AN/AN/AN/AN/AN/AN/AN/Acwrites a single character.  The argument is first converted to wchar_t as if by calling btowc. If the l modifier is used, the wint_t argument is first converted to wchar_t.N/AN/Aintwint_tN/AN/AN/AN/AN/Aswrites a character string  The argument must be a pointer to the initial element of a character array containing a multibyte character sequence beginning in the initial shift state, which is converted to wide character array as if by a call to mbrtowc with zero-initialized conversion state. Precision specifies the maximum number of wide characters to be written. If Precision is not specified, writes every wide characters up to and not including the first null terminator. If the l specifier is used, the argument must be a pointer to the initial element of an array of wchar_t.N/AN/Achar*wchar_t*N/AN/AN/AN/AN/Ad iconverts a signed integer into decimal representation -dddd.  Precision specifies the minimum number of digits to appear. The default precision is 1. If both the converted value and the precision are 0 the conversion results in no characters.signed charshortintlonglong longintmax_tsigned size_tptrdiff_tN/Aoconverts a unsigned integer into octal representation oooo.  Precision specifies the minimum number of digits to appear. The default precision is 1. If both the converted value and the precision are 0 the conversion results in no characters. In the alternative implementation precision is increased if necessary, to write one leading zero. In that case if both the converted value and the precision are 0, single 0 is written.unsigned charunsigned shortunsigned intunsigned longunsigned long longuintmax_tsize_tunsigned version of ptrdiff_tN/Ax Xconverts an unsigned integer into hexadecimal representation hhhh.  For the x conversion letters abcdef are used. For the X conversion letters ABCDEF are used. Precision specifies the minimum number of digits to appear. The default precision is 1. If both the converted value and the precision are 0 the conversion results in no characters. In the alternative implementation 0x or 0X is prefixed to results if the converted value is nonzero.N/Auconverts an unsigned integer into decimal representation dddd.  Precision specifies the minimum number of digits to appear. The default precision is 1. If both the converted value and the precision are 0 the conversion results in no characters.N/Af Fconverts floating-point number to the decimal notation in the style -ddd.ddd.  Precision specifies the minimum number of digits to appear after the decimal point character. The default precision is 6. In the alternative implementation decimal point character is written even if no digits follow it. For infinity and not-a-number conversion style see notes.N/AN/Adoubledouble (C99)N/AN/AN/AN/Along doublee  Econverts floating-point number to the decimal exponent notation.  For the e conversion style -d.ddde±dd is used. For the E conversion style -d.dddE±dd is used. The exponent contains at least two digits, more digits are used only if necessary. If the value is 0, the exponent is also 0. Precision specifies the minimum number of digits to appear after the decimal point character. The default precision is 6. In the alternative implementation decimal point character is written even if no digits follow it. For infinity and not-a-number conversion style see notes.N/AN/AN/AN/AN/AN/Aa  A (C99).converts floating-point number to the hexadecimal exponent notation.  For the a conversion style -0xh.hhhp±d is used. For the A conversion style -0Xh.hhhP±d is used. The first hexadecimal digit is 0 if the argument is not a normalized floating point value. If the value is 0, the exponent is also 0. Precision specifies the minimum number of digits to appear after the decimal point character. The default precision is sufficient for exact representation of the value. In the alternative implementation decimal point character is written even if no digits follow it. For infinity and not-a-number conversion style see notes.N/AN/AN/AN/AN/AN/Ag  Gconverts floating-point number to decimal or decimal exponent notation depending on the value and the precision.  For the g conversion style conversion with style e or f will be performed. For the G conversion style conversion with style E or F will be performed. Let P equal the precision if nonzero, 6 if the precision is not specified, or 1 if the precision is 0. Then, if a conversion with style E would have an exponent of X:   if P > X ≥ −4, the conversion is with style f or F and precision P − 1 − X.   otherwise, the conversion is with style e or E and precision P − 1.   Unless alternative representation is requested the trailing zeros are removed, also the decimal point character is removed if no fractional part is left. For infinity and not-a-number conversion style see notes.N/AN/AN/AN/AN/AN/An将此调用到目前为止写入的字符数返回给该函数。结果写入参数指向的值。规范可能不包含任何标志,字段宽度或精度。签名字符*短*INT *long*很长**将intmax_t签名size_t *ptrdiff_t的*N / Ap写一个实现定义的字符序列来定义一个指针。N / AN / A无效*N / AN / AN / AN / AN / AN / A

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值