C ¥æ¡¼¥¶¡¼¥º¥¬¥¤¥É ¥Û¡¼¥àÌܼ¡Á°¥Ú¡¼¥¸¤Ø¼¡¥Ú¡¼¥¸¤Øº÷°ú


ÉÕÏ¿ A

ANSI C ¥Ç¡¼¥¿É½¸½

¤³¤ÎÉÕÏ¿¤Ç¤Ï¡¢ANSI C ¤Îµ­²±ÁõÃ֤ˤª¤±¤ë¥Ç¡¼¥¿É½¸½¤È¡¢´Ø¿ô¤Ë°ú¿ô¤òÅϤ¹»ÅÁȤߤˤĤ¤¤ÆÀâÌÀ¤·¤Þ¤¹¡£ËܾϤϡ¢C ¸À¸ì°Ê³°¤Î¸À¸ì¤Ç¥â¥¸¥å¡¼¥ë¤òµ­½Ò¤·¤¿¤ê»ÈÍѤ·¤¿¤¤¾ì¹ç¤Ë¡¢¤³¤ì¤é¤Î¥â¥¸¥å¡¼¥ë¤Ë C ¸À¸ì¥³¡¼¥É¤Ø¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò»ý¤¿¤»¤ë¤¿¤á¤Î¼ê°ú¤­¤È¤·¤Æ½ñ¤«¤ì¤¿¤â¤Î¤Ç¤¹¡£ÀâÌÀ¹àÌܤϼ¡¤Î¤È¤ª¤ê¤Ç¤¹¡£

µ­²±ÁõÃ֤γä¤êÅö¤Æ

¥Ç¡¼¥¿·¿¤È¤½¤Îɽ¸½ÊýË¡¤Ë¤Ä¤¤¤Æɽ A-1 ¤Ë¤Þ¤È¤á¤Þ¤¹¡£

ɽ A-1   ¥Ç¡¼¥¿·¿¤ËÂФ¹¤ëµ­²±ÁõÃ֤γä¤êÅö¤Æ 
¥Ç¡¼¥¿·¿ ÆâÉôɽ¸½
char ·¿Í×ÁÇ 8 ¥Ó¥Ã¥ÈÉý¤Î¥·¥ó¥°¥ë¥Ð¥¤¥È¡£1 ¥Ð¥¤¥È¤Ç¶­³¦À°Î󤵤ì¤ë¡£
short ·¿À°¿ô ¥Ï¡¼¥Õ¥ï¡¼¥É (2 ¥Ð¥¤¥È¡¢¤Ä¤Þ¤ê 16 ¥Ó¥Ã¥È)¡£2 ¥Ð¥¤¥È¤Ç¶­³¦
À°Î󤵤ì¤ë¡£
int ·¿ v8 ¤Î 32 ¥Ó¥Ã¥È (4 ¥Ð¥¤¥È¡¢¤Ä¤Þ¤ê 1 ¥ï¡¼¥É)¡£4 ¥Ð¥¤¥È¤Ç¶­³¦À°Î󤵤ì¤ë¡£
long ·¿ v8 ¤Î 32 ¥Ó¥Ã¥È (4 ¥Ð¥¤¥È¡¢¤Ä¤Þ¤ê 1 ¥ï¡¼¥É)¡£4 ¥Ð¥¤¥È¤Ç¶­³¦À°Î󤵤ì¤ë¡£
v9 ¤Ç¤Ï 64 ¥Ó¥Ã¥È (4 ¥Ð¥¤¥È¡¢¤Ä¤Þ¤ê 1 ¥ï¡¼¥É)¡£8 ¥Ð¥¤¥È¶­³¦¤ÇÀ°Î󤵤ì¤ë¡£
long long ·¿1 (SPARC) 64 ¥Ó¥Ã¥È (8 ¥Ð¥¤¥È¡¢¤Ä¤Þ¤ê 2 ¥ï¡¼¥É)¡£
¥À¥Ö¥ë¥ï¡¼¥É¤Ç¶­³¦À°Î󤵤ì¤ë¡£
(x86) 64 ¥Ó¥Ã¥È (8 ¥Ð¥¤¥È¡¢¤Ä¤Þ¤ê 2 ¥ï¡¼¥É)¡£4 ¥Ð¥¤¥È¤Ç¶­³¦À°Î󤵤ì¤ë¡£
float ·¿ 32 ¥Ó¥Ã¥È (4 ¥Ð¥¤¥È¡¢¤Ä¤Þ¤ê 1 ¥ï¡¼¥É)¡£4 ¥Ð¥¤¥È¤Ç¶­³¦À°Î󤵤ì¤ë¡£1 ¥Ó¥Ã¥È¤ÎÉä¹æ¡¢8 ¥Ó¥Ã¥È¤Î»Ø¿ôÉô¤ª¤è¤Ó 23 ¥Ó¥Ã¥È¤Î²¾¿ôÉô¤«¤éÀ®¤ë¡£
double ·¿ 64 ¥Ó¥Ã¥È (8 ¥Ð¥¤¥È¡¢¤Ä¤Þ¤ê 2 ¥ï¡¼¥É)¡£
(SPARC) 8 ¥Ð¥¤¥È¤Ç¶­³¦À°Î󤵤ì¤ë¡£
(x86) 4 ¥Ð¥¤¥È¶­³¦¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£
1 ¥Ó¥Ã¥È¤ÎÉä¹æ¡¢11 ¥Ó¥Ã¥È¤Î»Ø¿ôÉô¡¢52 ¥Ó¥Ã¥È¤Î²¾¿ôÉô¤«¤éÀ®¤ë¡£
long double ·¿ v8 (SPARC) 128 ¥Ó¥Ã¥È (16 ¥Ð¥¤¥È¡¢¤Ä¤Þ¤ê 4 ¥ï¡¼¥É)¡£8 ¥Ð¥¤¥È¤Ç¶­³¦À°Î󤵤ì¤ë¡£1 ¥Ó¥Ã¥È¤ÎÉä¹æ¡¢15 ¥Ó¥Ã¥È¤Î»Ø¿ôÉô¤ª¤è¤Ó 112 ¥Ó¥Ã¥È¤Î²¾¿ôÉô¤«¤éÀ®¤ë¡£
v9 (SPARC) 128 ¥Ó¥Ã¥È (16 ¥Ð¥¤¥È¡¢¤Ä¤Þ¤ê 4 ¥ï¡¼¥É)¡£16 ¥Ð¥¤¥È¤Ç¶­³¦À°Î󤵤ì¤ë¡£1 ¥Ó¥Ã¥È¤ÎÉä¹æ¡¢15 ¥Ó¥Ã¥È¤Î»Ø¿ôÉô¤ª¤è¤Ó 112 ¥Ó¥Ã¥È¤Î²¾¿ôÉô¤«¤éÀ®¤ë¡£
(x86) 96 ¥Ó¥Ã¥È (12 ¥Ð¥¤¥È¡¢¤Ä¤Þ¤ê 3 ¥ï¡¼¥É)¡£4 ¥Ð¥¤¥È¤Ç¶­³¦À°Î󤵤ì¤ë¡£1 ¥Ó¥Ã¥È¤ÎÉä¹æ¡¢16 ¥Ó¥Ã¥È¤Î»Ø¿ôÉô¤ª¤è¤Ó 64 ¥Ó¥Ã¥È¤Î²¾¿ôÉô¤«¤éÀ®¤ë¡£16 ¥Ó¥Ã¥È¤Ï»ÈÍѤµ¤ì¤Ê¤¤¡£
1 long long ¤Ï -Xc ¥â¡¼¥É¤Ç¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡£


¥Ç¡¼¥¿É½¸½

»ÈÍѤ·¤Æ¤¤¤ë¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ë¤è¤Ã¤Æ¥Ç¡¼¥¿Í×ÁǤΥӥåÈÈÖ¹æ¤Î³ä¤êÅö¤Æ¤¬°Û¤Ê¤ê¤Þ¤¹¡£SPARCstation` ¤Ç¤Ï¥Ó¥Ã¥È 0 ¤òºÇ²¼°ÌÍ­¸ú¥Ó¥Ã¥È¡¢¥Ð¥¤¥È 0 ¤òºÇ¾å°ÌÍ­¸ú¥Ð¥¤¥È¤È¤·¤Æ¤½¤ì¤¾¤ì»ÈÍѤ·¤Þ¤¹¡£°Ê²¼¤Îɽ¤Ëɽ¸½ÊýË¡¤ò¼¨¤·¤Þ¤¹¡£

À°¿ôɽ¸½

ANSI C ¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ëÀ°¿ô·¿¤Ï short¡¢int¡¢long¡¢¤ª¤è¤Ó long long ¤Ç¤¹¡£

ɽ A-2   short ¤Îɽ¸½ (x86)  
¥Ó¥Ã¥È ÆâÍÆ
8 - 15
¥Ð¥¤¥È 0 (SPARC)
¥Ð¥¤¥È 1 (x86)
0 - 7
¥Ð¥¤¥È 1 (SPARC)
¥Ð¥¤¥È 0 (x86)


ɽ A-3   int ¤È long ¤Îɽ¸½
¥Ó¥Ã¥È ÆâÍÆ
24 - 31
¥Ð¥¤¥È 0 (SPARC)
¥Ð¥¤¥È 3 (x86)
16 - 23
¥Ð¥¤¥È 1 (SPARC)
¥Ð¥¤¥È 2 (x86)
8 - 15
¥Ð¥¤¥È 2 (SPARC)
¥Ð¥¤¥È 1 (x86)
0 - 7
¥Ð¥¤¥È 3 (SPARC)
¥Ð¥¤¥È 0 (x86)


ɽ A-4   long ¤Îɽ¸½ (Intel¡¢SPARC v8¡¢SPARC v9)  
¥Ó¥Ã¥È ÆâÍÆ
24 - 31
¥Ð¥¤¥È 0 (SPARC) v8
¥Ð¥¤¥È 4 (SPARC) v9
¥Ð¥¤¥È 3 (Intel)
16 - 23
¥Ð¥¤¥È 1 (SPARC) v8
¥Ð¥¤¥È 5 (SPARC) v9
¥Ð¥¤¥È 2 (Intel)
8 - 15
¥Ð¥¤¥È 2 (SPARC) v8
¥Ð¥¤¥È 6 (SPARC) v9
¥Ð¥¤¥È 1 (Intel)
0 - 7
¥Ð¥¤¥È 3 (SPARC) v8
¥Ð¥¤¥È 7 (SPARC) v9
¥Ð¥¤¥È 0 (Intel)


ɽ A-5   long long1 ¤Îɽ¸½  
¥Ó¥Ã¥È ÆâÍÆ
56 - 63
¥Ð¥¤¥È 0 (SPARC)
¥Ð¥¤¥È 7 (x86)
48 - 55
¥Ð¥¤¥È 1 (SPARC)
¥Ð¥¤¥È 6 (x86)
40 - 47
¥Ð¥¤¥È 2 (SPARC)
¥Ð¥¤¥È 5 (x86)
32 - 39
¥Ð¥¤¥È 3 (SPARC)
¥Ð¥¤¥È 4 (x86)
24 - 31
¥Ð¥¤¥È 4 (SPARC)
¥Ð¥¤¥È 3 (x86)
16 - 23
¥Ð¥¤¥È 5 (SPARC)
¥Ð¥¤¥È 2 (x86)
8 - 15
¥Ð¥¤¥È 6 (SPARC)
¥Ð¥¤¥È 1 (x86)
0 - 7
¥Ð¥¤¥È 7 (SPARC)
¥Ð¥¤¥È 0 (x86)
1 long long ¤Ï -Xc ¥â¡¼¥É¤Ç¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡£


ÉâÆ°¾®¿ôÅÀɽ¸½

float¡¢double¡¢long double ¤Î¥Ç¡¼¥¿Í×ÁǤϡ¢ANSI/ISO IEEE 754-1985 µ¬³Ê¤Ë½¾¤Ã¤Æ²¼¤Î¼°¤Î¤è¤¦¤Ëɽ¸½¤µ¤ì¤Þ¤¹¡£

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡(-1)s2(e - bias) ¥ j.f

¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢¡Ø¿ôÃÍ·×»»¥¬¥¤¥É¡Ù¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

¶ËÃÍɽ¸½

Àµµ¬²½¤µ¤ì¤¿ float ¤È double ¤Î¿ô¤Ï¡Ö±£¤µ¤ì¤¿¡×¥Ó¥Ã¥È¤Þ¤¿¤Ï°ÅÌۤΥӥåȤò»ý¤Ä¤È¸À¤ï¤ì¤Þ¤¹¡£¤½¤ì¤Ë¤è¤ê¡¢ÀºÅÙ¤ò 1 ¥Ó¥Ã¥Èʬ¹â¤á¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
long double ¤Î¾ì¹ç¤Ï¡¢Àè¹Ô¥Ó¥Ã¥È¤Ï°ÅÌÛŪ (SPARC) ¤Þ¤¿¤ÏÌÀ¼¨Åª (x86) ¤Î¤¤¤º¤ì¤«¤Ë¤Ê¤ê¤Þ¤¹¡£¤³¤Î¥Ó¥Ã¥È¤ÏÀµµ¬¿ô¤ËÂФ·¤Æ¤Ï 1¡¢ÈóÀµµ¬¿ô¤ËÂФ·¤Æ¤Ï 0 ¤Ë¤Ê¤ê¤Þ¤¹¡£

ɽ A-10   float ¤Îɽ¸½
Àµµ¬¿ô
(0<e<255):
ÈóÀµµ¬¿ô
(e=0, f!=0):
¥¼¥í (e=0, f=0):
¥·¥°¥Ê¥ë¤òȯÀ¸¤¹¤ë NaN s=u, e=255(ºÇÂçÃÍ); f=.0uuu¡Áuu (¾¯¤Ê¤¯¤È¤â 1 ¥Ó¥Ã¥È¤Ï 0 °Ê³°)
¥·¥°¥Ê¥ë¤òȯÀ¸¤·¤Ê¤¤ NaN s=u, e=255(ºÇÂçÃÍ); f=.1uuu¡Áuu
̵¸ÂÂç s=u, e=255(ºÇÂçÃÍ); f=.0000¡Á00 (¤¹¤Ù¤Æ¤¬ 0)


ɽ A-11   double ¤Îɽ¸½  
Àµµ¬¿ô
(0<e<2047):
ÈóÀµµ¬¿ô
(e=0, f!=0):
¥¼¥í (e=0, f=0):
¥·¥°¥Ê¥ë¤òȯÀ¸¤¹¤ë NaN s=u, e=2047(ºÇÂçÃÍ); f=.0uuu¡Áuu (¾¯¤Ê¤¯¤È¤â 1 ¥Ó¥Ã¥È¤Ï 0 °Ê³°)
¥·¥°¥Ê¥ë¤òȯÀ¸¤·¤Ê¤¤ NaN s=u, e=2047(ºÇÂçÃÍ); f=.1uuu¡Áuu
̵¸ÂÂç s=u, e=2047(ºÇÂçÃÍ); f=.0000¡Á00 (¤¹¤Ù¤Æ¤¬ 0)


ɽ A-12   long double ¤Îɽ¸½
Àµµ¬¿ô
(0<e<32767):
ÈóÀµµ¬¿ô
(e=0, f!=0):
¥¼¥í (e=0, f=0):
¥·¥°¥Ê¥ë¤òȯÀ¸¤¹¤ë NaN s=u, e=32767(ºÇÂçÃÍ); f=1.0uuu¡Áuu (¾¯¤Ê¤¯¤È¤â 1 ¥Ó¥Ã¥È¤Ï 0 °Ê³°)
¥·¥°¥Ê¥ë¤òȯÀ¸¤·¤Ê¤¤ NaN s=u, e=32767(ºÇÂçÃÍ); f=1.1uuu¡Áuu
̵¸ÂÂç s=u, e=32767(ºÇÂçÃÍ); f=1.0000¡Á00 (¤¹¤Ù¤Æ¤¬ 0)


½ÅÍפʿô¤Î 16 ¿Ê¿ôɽ¸½

¤è¤¯»ÈÍѤµ¤ì¤ë¿ôÃͤÎ16 ¿Ê¿ôɽ¸½¤ò¼¡¤Îɽ¤Ë¤Þ¤È¤á¤Þ¤¹¡£

ɽ A-13   ½ÅÍפʿô¤Î 16 ¿Ê¿ôɽ¸½ (SPARC)

ÃÍ

float ·¿

double ·¿

long double ·¿

+0
-0
00000000
80000000
0000000000000000
8000000000000000
00000000000000000000000000000000
80000000000000000000000000000000
+1.0
-1.0
3F800000
BF800000
3FF0000000000000
BFF0000000000000
3FFF00000000000000000000000000000
BFFF00000000000000000000000000000
+2.0
+3.0
40000000
40400000
4000000000000000
4008000000000000
40000000000000000000000000000000
40080000000000000000000000000000
+̵¸Â
-̵¸Â
7F800000
FF800000
7FF0000000000000
FFF0000000000000
7FFF00000000000000000000000000000
FFFF00000000000000000000000000000
NaN 7FBFFFFF 7FF7FFFFFFFFFFFF 7FFF7FFFFFFFFFFFFFFFFFFFFFFFFFFF


ɽ A-14   ½ÅÍפʿô¤Î 16 ¿Ê¿ôɽ¸½ (x86)

ÃÍ

float ·¿

double ·¿

long double ·¿

+0
-0
00000000
80000000
0000000000000000
0000000080000000
00000000000000000000
80000000000000000000
+1.0
-1.0
3F800000
BF800000
000000003FF00000
00000000BFF00000
3FFF8000000000000000
BFFF8000000000000000
+2.0
+3.0
40000000
40400000
0000000040000000
0000000040080000
40008000000000000000
4000C000000000000000
+̵¸Â
-̵¸Â
7F800000
FF800000
000000007FF00000
00000000FFF00000
7FFF8000000000000000
FFFF8000000000000000
NaN 7FBFFFFF FFFFFFFF7FF7FFFF 7FFFBFFFFFFFFFFFFFFF


¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢¡Ø¿ôÃÍ·×»»¥¬¥¤¥É¡Ù¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

¥Ý¥¤¥ó¥¿É½¸½

C ¸À¸ì¤Ë¤ª¤±¤ë¥Ý¥¤¥ó¥¿¤Ï 4 ¥Ð¥¤¥È¤ò»ÈÍѤ·¤Þ¤¹¡£NULL ÃͤΥݥ¤¥ó¥¿¤Ï¥¼¥í¤ÈÅù²Á¤Ç¤¹¡£

ÇÛÎó¤Î³ÊǼ

ÇÛÎó¤Ï¡¢¤½¤ì¤¾¤ì¤ÎÍ×ÁǤ¬·è¤á¤é¤ì¤¿µ­²±½ç½ø¤Ç³ÊǼ¤µ¤ì¤Þ¤¹¡£³ÆÍ×ÁǤϼºݤˤϵ­²±Í×ÁǤΰ켡¸µ¤ÎÎó¤Ë³ÊǼ¤µ¤ì¤Þ¤¹¡£

C ¸À¸ì¤ÎÇÛÎó¤Ï¹Ô¤ÎʤӤòÍ¥À褷¤Æ³ÊǼ¤µ¤ì¤Þ¤¹¡£¤³¤Î½ç½ø¤Ç¤Ï¡¢Â¿¼¡¸µÇÛÎó¤Ë¤ª¤±¤ë±¦Ã¼¤Îź»ú¤¬ºÇ¤â®¤¯ÊѲ½¤·¤Þ¤¹¡£

ʸ»úÎó¥Ç¡¼¥¿·¿¤Ï char Í×ÁǤÎÇÛÎó¤Ë¤Ê¤ê¤Þ¤¹¡£Ï¢·ë¸å¡¢Ê¸»úÎó¥ê¥Æ¥é¥ë¤Þ¤¿¤Ï¥ï¥¤¥Éʸ»úÎó¥ê¥Æ¥é¥ë¤Ë»ØÄê¤Ç¤­¤ëºÇÂç¤Îʸ»ú¿ô¤Ï¡¢4,294,967,295 ¸Ä¤Ç¤¹¡£

ɽ A-15   ¼«Æ°ÇÛÎó¤Î·¿¤ÈºÇÂç¤ÎÂ礭¤µ 
·¿ SPARC ¤ª¤è¤Ó Intel ¤ÎºÇÂçÍ×ÁÇ¿ô SPARC V9 ¤ÎºÇÂçÍ×ÁÇ¿ô
char
4,294,967,295 2,305,843,009,213,693,951
short 2,147,483,647 1,152,921,504,606,846,975
int 1,073,741,823 576,460,752,303,423,487
long 1,073,741,823 288,230,376,151,711,743
float 1,073,741,823 576,460,752,303,423,487
double 536,870,911 288,230,376,151,711,743
long double 268,435,451 144,115,188,075,855,871
long long1 536,870,911 288,230,376,151,711,743
1 -Xc ¥â¡¼¥É¤Ç¤Ï̵¸ú¤Ç¤¹¡£


ÀÅŪ¤ª¤è¤ÓÂç°èÇÛÎó¤Ë¤Ï¤µ¤é¤Ë¿¤¯¤ÎÍ×ÁǤò³ÊǼ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

¶ËÃͤλ»½Ñ±é»»

¤³¤ÎÀá¤Ç¤Ï¡¢ÉâÆ°¾®¿ôÅÀ¤Î¶ËÃͤÈÄ̾ïÃͤòÁȤ߹ç¤ï¤»¤¿¤â¤Î¤Ë´ðËÜ»»½Ñ±é»»¤òŬÍѤ·¤ÆÆÀ¤é¤ì¤ë·ë²Ì¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹¡£

¥È¥é¥Ã¥×¤ä¤½¤Î¾¤ÎÎã³°¤Ïµ¯¤³¤é¤Ê¤¤¤â¤Î¤È¤·¤Þ¤¹¡£

¼¡¤Îɽ¤Ç¡¢Î¬¸ì¤Î°ÕÌ£¤òÀâÌÀ¤·¤Þ¤¹¡£

ɽ A-16   Î¬¸ì¤Î»ÈÍÑË¡
ά¸ì °ÕÌ£
Num
ÈóÀµµ¬¤Î¤Þ¤¿¤ÏÀµµ¬²½¤µ¤ì¤¿¿ô»ú
Inf
̵¸ÂÂç (Àµ¤Þ¤¿¤ÏÉé)
NaN
¿ô»ú¤Ç¤Ï¤Ê¤¤
Uno
½ç½øÉÔÄê


¼¡¤Îɽ¤Ï¡¢°Û¤Ê¤ë¥¿¥¤¥×¤Î¥ª¥Ú¥é¥ó¥É¤òÁȤ߹ç¤ï¤»¤Æ¹Ô¤Ê¤Ã¤¿»»½Ñ±é»»¤«¤éÆÀ¤é¤ì¤¿ÃͤΥ¿¥¤¥×¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£

ɽ A-17   ²Ã»»¤È¸º»»¤Î·ë²Ì  
²Ã»»¤ª¤è¤Ó¸º»»
º¸¤Î¥ª¥Ú¥é¥ó¥É ±¦¤Î¥ª¥Ú¥é¥ó¥É
0 Num Inf NaN
0 0 Num Inf NaN
Num Num Ãí¤ò»²¾È Inf NaN
Inf Inf Inf Ãí¤ò»²¾È NaN
NaN NaN NaN NaN NaN



Ãí - Num + Num ¤Ï¡¢·ë²Ì ¤¬ Â礭¤¹¤®¤ë (¥ª¡¼¥Ð¡¼¥Õ¥í¡¼) ¤È Num ¤Ç¤Ï¤Ê¤¯ Inf ¤Ë¤Ê¤ê¤Þ¤¹¡£Inf + Inf ¤Ï¡¢Ìµ¸ÂÂç¤ÎÉä¹æ¤¬µÕ¤Ç¤¢¤ì¤Ð NaN ¤Ë¤Ê¤ê¤Þ¤¹¡£

ɽ A-18   ¾è»»·ë²Ì  
¾è»»
º¸¤Î¥ª¥Ú¥é¥ó¥É ±¦¤Î¥ª¥Ú¥é¥ó¥É
0 Num Inf NaN
0 0 0 NaN NaN
Num 0 Num Inf NaN
Inf NaN Inf Inf NaN
NaN NaN NaN NaN NaN


ɽ A-19   ½ü»»·ë²Ì
½ü»»
º¸¤Î¥ª¥Ú¥é¥ó¥É ±¦¤Î¥ª¥Ú¥é¥ó¥É
0 Num Inf NaN
0 NaN 0 0 NaN
Num Inf Num 0 NaN
Inf Inf Inf NaN NaN
NaN NaN NaN NaN NaN


ɽ A-20   Èæ³Ó·ë²Ì
Èæ³Ó
º¸¤Î¥ª¥Ú¥é¥ó¥É ±¦¤Î¥ª¥Ú¥é¥ó¥É
0 +Num +Inf NaN
0 = < < Uno
+Num > Èæ³Ó·ë²Ì < Uno
+Inf > > = Uno
NaN Uno Uno Uno Uno




Ãí - NaN ¤ÈÈæ³Ó¤·¤¿ NaN ¤Ï½ç½øÉÔÄê¤Ç¡¢·ë²Ì¤ÏÉÔÅù²Á¤Ë¤Ê¤ê¤Þ¤¹¡£+0 ¤Ï ¾0 ¤ÈÈæ³Ó·ë²Ì¤¬Åù¤·¤¯¤Ê¤ê¤Þ¤¹¡£

°ú¿ô¤òÅϤ¹»ÅÁȤß

ËÜÀá¤Ç¤Ï ANSI/ISO C ¤Ë¤ª¤±¤ë°ú¿ô¤ÎÅϤ·Êý¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹¡£

C ¤Î´Ø¿ô¤Ø¤Î°ú¿ô¤Ï¡¢¤¹¤Ù¤ÆÃÍÅϤ·¤µ¤ì¤Þ¤¹¡£

¼Â°ú¿ô¤Ï´Ø¿ô¤ÎÀë¸À¤Ë¤ª¤¤¤ÆÀë¸À¤µ¤ì¤ë¤Î¤ÈµÕ¤Î½ç½ø¤ÇÅϤµ¤ì¤Þ¤¹¡£

¼Â°ú¿ô¤¬¼°¤Î¾ì¹ç¡¢´Ø¿ô»²¾È¤ÎÁ°¤Ëɾ²Á¤µ¤ì¤Þ¤¹¡£¤½¤Î¸å¡¢¼°¤Î·ë²Ì¤¬¥ì¥¸¥¹¥¿¤ËÃÖ¤«¤ì¤ë¤«¥¹¥¿¥Ã¥¯¤Ë¥×¥Ã¥·¥å¤µ¤ì¤Þ¤¹¡£

(SPARC)

´Ø¿ô¤Ï integer ·¿¤Î·ë²Ì¤ò¥ì¥¸¥¹¥¿ %o0 ¤ËÊÖ¤·¤Þ¤¹¡£float ·¿¤Î·ë²Ì¤Ï¥ì¥¸¥¹¥¿
%f0 ¤Ë¡¢double ·¿¤Î·ë²Ì¤Ï¥ì¥¸¥¹¥¿ %f0 ¤È %f1 ¤ËÊÖ¤·¤Þ¤¹¡£
long long ·¿1 À°¿ô¤Ï¾å°Ì¥ï¡¼¥É¤Ï %oN¡¢²¼°Ì¥ï¡¼¥É¤Ï %o (N+1) ¤È¤¤¤¦¤è¤¦¤Ë¥ì¥¸¥¹¥¿¤ËÅϤµ¤ì¤Þ¤¹¡£¥ì¥¸¥¹¥¿Æâ¤Î·ë²Ì¤ÏƱÍͤνç½ø¤Ç %i0 ¤È %i1 ¤ËÊÖ¤µ¤ì¤Þ¤¹¡£
double ¤ª¤è¤Ó long double ·¿¤ò½ü¤¯¤¹¤Ù¤Æ¤Î°ú¿ô¤Ï 4 ¥Ð¥¤¥È¤ÎÃͤȤ·¤ÆÅϤµ¤ì¤Þ¤¹¡£double ·¿¤Ï 8 ¥Ð¥¤¥È¤ÎÃͤȤ·¤ÆÅϤµ¤ì¤Þ¤¹¡£ÀèƬ 6 ¸Ä¤Î 4 ¥Ð¥¤¥ÈÃÍ (double ¤ò 8 ¤È¿ô¤¨¤ë) ¤Ï %o0 ¤«¤é %o5 ¤Þ¤Ç¤Î¥ì¥¸¥¹¥¿¤ËÅϤµ¤ì¡¢»Ä¤ê¤Ï¥¹¥¿¥Ã¥¯·Ðͳ¤ÇÅϤµ¤ì¤Þ¤¹¡£¹½Â¤ÂΤξì¹ç¤Ï¡¢¹½Â¤ÂΤΥ³¥Ô¡¼¤¬ºîÀ®¤µ¤ì¡¢¥Ý¥¤¥ó¥¿¤¬¤½¤Î¥³¥Ô¡¼¤ËÅϤµ¤ì¤Þ¤¹¡£long double ¤Ï¹½Â¤ÂΤÈƱÍͤËÅϤµ¤ì¤Þ¤¹¡£
´Ø¿ô¤«¤éÌá¤Ã¤¿¸å¡¢¥¹¥¿¥Ã¥¯¤«¤é°ú¿ô¤ò¥Ý¥Ã¥×¤¹¤ë¤Î¤Ï¸Æ¤Ó½Ð¤·Â¦¤ÎÀÕǤ¤Ç¤¹¡£¾åµ­¤Î¥ì¥¸¥¹¥¿¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¤«¤é¸«¤¨¤Þ¤¹¡£

(x86)

´Ø¿ô¤Ï integer ·¿¤Î·ë²Ì¤ò¥ì¥¸¥¹¥¿ %eax ¤ËÊÖ¤·¤Þ¤¹¡£
long long ¤Î·ë²Ì¤Ï¥ì¥¸¥¹¥¿ %edx ¤È %eax ¤ËÊÖ¤µ¤ì¤Þ¤¹¡£float¡¢double¡¢
long
double ·¿¤Î·ë²Ì¤Ï¥ì¥¸¥¹¥¿ %st(0) ¤ËÊÖ¤µ¤ì¤Þ¤¹¡£
struct¡¢union¡¢long long¡¢double¡¢long double ¤ò½ü¤¯¤¹¤Ù¤Æ¤Î°ú¿ô¤Ï 4 ¥Ð¥¤¥ÈÃͤȤ·¤ÆÅϤµ¤ì¤Þ¤¹¡£long long ¤Ï 8 ¥Ð¥¤¥ÈÃͤȤ·¤Æ¡¢¤Þ¤¿ long double ¤Ï 12 ¥Ð¥¤¥ÈÃͤȤ·¤Æ¤½¤ì¤¾¤ìÅϤµ¤ì¤Þ¤¹¡£
struct ¤È union ¤Ï¥¹¥¿¥Ã¥¯¤Ë¥³¥Ô¡¼¤µ¤ì¤Þ¤¹¡£¥µ¥¤¥º¤Ï 4 ¤ÎÇÜ¿ô¥Ð¥¤¥È¤Ë´Ý¤á¤é¤ì¤Þ¤¹¡£struct ¤È union ¤òÊÖ¤¹´Ø¿ô¤Ï¡¢¤½¤Î struct ¤ä union ¤ò³ÊǼ¤¹¤ë¾ì½ê¤ò»Ø¤¹±£¤µ¤ì¤¿ºÇ½é¤Î°ú¿ô¤ËÅϤµ¤ì¤Þ¤¹¡£
´Ø¿ô¤«¤éÌá¤Ã¤¿¸å¡¢¥¹¥¿¥Ã¥¯¤«¤é°ú¿ô¤ò¥Ý¥Ã¥×¤¹¤ë¤Î¤Ï¸Æ¤Ó½Ð¤·Â¦¤ÎÀÕǤ¤Ç¤¹ (¸Æ¤Ó½Ð¤µ¤ì¤¿´Ø¿ô¤Ë¤è¤Ã¤Æ¥Ý¥Ã¥×¤µ¤ì¤ë struct ¤ä union ¤Î;ʬ¤Ê°ú¿ô¤ò½ü¤¯)¡£
1 -Xc ¥â¡¼¥É¤Ç¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡£


¥µ¥ó¡¦¥Þ¥¤¥¯¥í¥·¥¹¥Æ¥à¥º³ô¼°²ñ¼Ò
Copyright information. All rights reserved.
¥Û¡¼¥à   |   Ìܼ¡   |   Á°¥Ú¡¼¥¸¤Ø   |   ¼¡¥Ú¡¼¥¸¤Ø   |   º÷°ú