Skip to content

M_PI not defined #2

@micheltallon

Description

@micheltallon

Error in compilation on Linux Mint 20.2 (Uma).

ipy.c: In function Y_ipy_init:
ipy.c:439:33: error: M_PI undeclared (first use in this function)
  439 |   define_double_const("IPY_PI", M_PI);
      |                                 ^~~~

This is solved by adding this line in ipy.c

#define __USE_MISC /* For M_PI */

This is because in math.h M_PI is now guarded:

#if defined __USE_MISC || defined __USE_XOPEN
[...]
# define M_PI           3.14159265358979323846  /* pi */
[...]
#endif

Cheers
Michel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions