「C言語/標準ライブラリ/inttypes.h」の版間の差分

削除された内容 追加された内容
Ef3 (トーク | 投稿記録)
タグ: 2017年版ソースエディター
Ef3 (トーク | 投稿記録)
タグ: 2017年版ソースエディター
76 行
uintmax_t wcstoumax(const wchar_t *restrict nptr, wchar_t **restrict endptr, int base);
</syntaxhighlight>
 
7.8.2 Functions for greatest-width integer types
=== imaxabs関数 ===
ISO/IEC 9899:2017 § 7.8.2.1 ''The imaxabs function''<ref name="jtc1-sc22-wg14-n2596-7.8.2.1">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 159, §7.8.2.1 ''The imaxabs function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
1 #include <inttypes.h>
intmax_t imaxabs(intmax_t j);
</syntaxhighlight>
; 機能
: imaxabs関数は、整数jの絶対値を計算します。
; 返却値
: imaxabs関数は、絶対値を返します。
 
=== imaxdiv関数 ===
ISO/IEC 9899:2017 § 7.8.2.2 ''The imaxdiv function''<ref name="jtc1-sc22-wg14-n2596-7.8.2.2">{{cite book
| url = http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archiveurl = https://web.archive.org/web/20181230041359/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf
| archivedate = 2018-12-30
| title = N2176 C17 ballot ISO/IEC 9899:2017
| page = 159, §7.8.2.2 ''The imaxdiv function''
| publisher = ISO/IEC JTC1/SC22/WG14}}</ref>。
; 形式 : <syntaxhighlight lang=C>
1 #include <inttypes.h>
imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
</syntaxhighlight>
; 機能
2 The imaxdiv function computes numer / denom and numer % denom in a single operation.
; 返却値
3 The imaxdiv function returns a structure of type imaxdiv_t comprising both the quotient and the
remainder. The structure shall contain (in either order) the members quot (the quotient) and rem
(the remainder), each of which has type intmax_t. If either part of the result cannot be represented,the behavior is undefined.
 
=== strtoimax関数とstrtoumaximaxdiv関数 ===
{{Anchor|strtoimax | strtoumax}}
7.8.2.3 The strtoimax and strtoumax functions
; 形式 : <syntaxhighlight lang=C>
1 #include <inttypes.h>
intmax_t strtoimax(const char * restrict nptr,char ** restrict endptr, int base);
uintmax_t strtoumax(const char * restrict nptr,char ** restrict endptr, int base);
</syntaxhighlight>
; 機能
2 The strtoimax and strtoumax functions are equivalent to the strtol, strtoll, strtoul, and
strtoull functions, except that the initial portion of the string is converted to intmax_t and
uintmax_t representation, respectively.
; 返却値
3 The strtoimax and strtoumax functions return the converted value, if any. If no conversion could
be performed, zero is returned. If the correct value is outside the range of representable values,INTMAX_MAX, INTMAX_MIN, or UINTMAX_MAX is returned (according to the return type and sign of the
value, if any), and the value of the macro ERANGE is stored in errno.
 
=== wcstoimax関数とwcstoumax関数 ===
{{Anchor|wcstoimax | wcstoumax}}
7.8.2.4 The wcstoimax and wcstoumax functions
; 形式 : <syntaxhighlight lang=C>
1 #include <stddef.h> // for wchar_t
#include <inttypes.h>
intmax_t wcstoimax(const wchar_t * restrict nptr,wchar_t ** restrict endptr, int base);
uintmax_t wcstoumax(const wchar_t * restrict nptr,wchar_t ** restrict endptr, int base);
</syntaxhighlight>
; 機能
2 The wcstoimax and wcstoumax functions are equivalent to the wcstol, wcstoll, wcstoul, and
wcstoull functions except that the initial portion of the wide string is converted to intmax_t and
uintmax_t representation, respectively.
; 返却値
3 The wcstoimax function returns the converted value, if any. If no conversion could be performed, zero is returned. If the correct value is outside the range of representable values, INTMAX_MAX, INTMAX_MIN, or UINTMAX_MAX is returned (according to the return type and sign of the value, if any),and the value of the macro ERANGE is stored in errno.
 
== 具体的な値の例 ==