logb

Autres langues

Langue: ja

Version: 2004-10-31 (openSuse - 09/10/07)

Section: 3 (Bibliothèques de fonctions)

̾Á°

logb, logbf, logbl - ÉâÆ°¾®¿ôÅÀ¿ô¤Î»Ø¿ô¤ò¼èÆÀ¤¹¤ë

½ñ¼°

#include <math.h>

double logb(double x);
float logbf(float x);
long double logbl(long double x);

-lm ¤Ç¥ê¥ó¥¯¤¹¤ë¡£

ÀâÌÀ

¤³¤ì¤é¤Î´Ø¿ô¤Ï x ¤Î»Ø¿ô¤òÃê½Ð¤·¡¢ÉâÆ°¾®¿ôÅÀ¿ô¤È¤·¤ÆÊÖ¤¹¡£ FLT_RADIX ¤¬ 2 ¤Î¾ì¹ç¡¢ logb(x) ¤Ï floor(log2(x)) ¤ÈÅù¤·¤¤¤¬¡¢¸å¼Ô¤ÎÊý¤¬¤¿¤Ö¤ó¹â®¤Ç¤¢¤ë¡£

x ¤¬Àµµ¬²½¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ logb() ¤Ï x ¤¬Àµµ¬²½¤µ¤ì¤¿¾ì¹ç¤Î»Ø¿ô¤òÊÖ¤¹¡£

x ¤¬ 0 ¤Î¾ì¹ç¡¢-HUGE_VAL, -HUGE_VALF, -HUGE_VALL ¤¬¤½¤ì¤¾¤ìÊÖ¤µ¤ì¤Æ¡¢ ¶Ë (pole) ¤Ë¤è¤ë¥¨¥é¡¼¤¬µ¯¤­¤ë¡£ x ¤¬Ìµ¸ÂÂç¤Î¾ì¹ç¡¢Àµ¤Î̵¸ÂÂ礬ÊÖ¤µ¤ì¤ë¡£ x ¤¬ NaN ¤Î¾ì¹ç¡¢NaN ¤¬ÊÖ¤µ¤ì¤ë¡£

¥¨¥é¡¼

¥¨¥é¡¼¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë errno ¤ò 0 ¤ËÀßÄꤷ¡¢ feclearexcept(FE_ALL_EXCEPT) ¤ò¸Æ¤Ó½Ð¤¹¡£ ¤³¤ì¤é¤Î´Ø¿ô¤«¤éÊ֤俸å¤Ç¡¢ errno ¤¬ 0 °Ê³°¤Þ¤¿¤Ï fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) ¤¬ 0 °Ê³°¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥¨¥é¡¼¤¬µ¯¤­¤Æ¤¤¤ë¡£

¥¨¥é¡¼¤¬µ¯¤­¤Æ¤¤¤Æ¡¢¤«¤Ä (math_errhandling & MATH_ERRNO) ¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢ errno ¤¬ ERANGE ¤ËÀßÄꤵ¤ì¤ë¡£ ¥¨¥é¡¼¤¬µ¯¤­¤Æ¤¤¤Æ¡¢¤«¤Ä (math_errhandling & MATH_ERREXCEPT) ¤¬ 0 °Ê³°¤Î¾ì¹ç¡¢0 ¤Ç³ä¤Ã¤¿¤³¤È¤Ë¤è¤ëÉâÆ°¾®¿ôÅÀ¿ô¤ÎÎã³°¤¬È¯À¸¤¹¤ë¡£

x ¤¬ 0 ¤Î¾ì¹ç¡¢¶Ë¤Ë¤è¤ë¥¨¥é¡¼¤¬µ¯¤­¤ë¡£

½àµò

C99

´ØÏ¢¹àÌÜ

log(3), ilogb(3)