man for cmath

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peng Yu

    man for cmath

    Hi,

    I need to look up the constants defined in cmath. Although I could
    read math.h directly, I'm wondering if there is a man page for it on
    linux system?

    Thanks,
    Peng
  • Matthias Buelow

    #2
    Re: man for cmath

    man sin

    Also helpful is man -k, for example "man -k math". On my installation,
    it will show math.h(7posix) which is from the POSIX manpages packages.
    However, manpages (and documentation in general) are a sad affair on
    Linux, so YMMV.

    Comment

    • Peng Yu

      #3
      Re: man for cmath

      On Jul 14, 8:29 am, Matthias Buelow <m...@incubus.d ewrote:
      man sin
      >
      Also helpful is man -k, for example "man -k math". On my installation,
      it will show math.h(7posix) which is from the POSIX manpages packages.
      However, manpages (and documentation in general) are a sad affair on
      Linux, so YMMV.
      But neither sin nor "man -k math" would give me the constants, such
      as M_PI.

      Thanks,
      Peng

      Comment

      • Peng Yu

        #4
        Re: man for cmath

        On Jul 14, 12:39 pm, r...@zedat.fu-berlin.de (Stefan Ram) wrote:
        Peng Yu <PengYu...@gmai l.comwrites:
        But neither sin nor "man -k math" would give me the constants,
        such as M_PI.
        >
        There does not seem to be such an identifier in cmath.
        >
        See »7.12 Mathematics <math.h>« in
        >

        >
        . To C, pi is 4 * atan(1.0).
        But how come in math.h in the GCC distribution, there are the
        following line. You mean these constants are not standard conformable?

        #if defined __USE_BSD || defined __USE_XOPEN
        # define M_E 2.7182818284590 452354 /* e */
        # define M_LOG2E 1.4426950408889 634074 /* log_2 e */
        # define M_LOG10E 0.4342944819032 5182765 /* log_10 e */
        # define M_LN2 0.6931471805599 4530942 /* log_e 2 */
        # define M_LN10 2.3025850929940 4568402 /* log_e 10 */
        # define M_PI 3.1415926535897 9323846 /* pi */
        # define M_PI_2 1.5707963267948 9661923 /* pi/2 */
        # define M_PI_4 0.7853981633974 4830962 /* pi/4 */
        # define M_1_PI 0.3183098861837 9067154 /* 1/pi */
        # define M_2_PI 0.6366197723675 8134308 /* 2/pi */
        # define M_2_SQRTPI 1.1283791670955 1257390 /* 2/sqrt(pi) */
        # define M_SQRT2 1.4142135623730 9504880 /* sqrt(2) */
        # define M_SQRT1_2 0.7071067811865 4752440 /* 1/sqrt(2) */
        #endif


        Thanks,
        Peng

        Comment

        • Paavo Helde

          #5
          Re: man for cmath

          Peng Yu <PengYu.UT@gmai l.comkirjutas:
          On Jul 14, 12:39 pm, r...@zedat.fu-berlin.de (Stefan Ram) wrote:
          >Peng Yu <PengYu...@gmai l.comwrites:
          >But neither sin nor "man -k math" would give me the constants,
          >such as M_PI.
          >>
          > There does not seem to be such an identifier in cmath.
          >>
          > See »7.12 Mathematics <math.h>« in
          >>
          >http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n843.htm
          >>
          > . To C, pi is 4 * atan(1.0).
          >
          But how come in math.h in the GCC distribution, there are the
          following line. You mean these constants are not standard conformable?
          After 3 minutes of Google search:

          http://www.network-theory.co.uk/docs...cintro_27.html :

          "The constant M_PI is not part of the ANSI/ISO C standard library (it
          comes from the BSD version of Unix)."

          hth
          Paavo

          Comment

          Working...