Name:

libraryconstant binds an external mathematical constant to a variable in Sollya

Library names:

sollya_obj_t sollya_lib_libraryconstant(char *, void (*)(mpfr_t, mp_prec_t)) sollya_obj_t sollya_lib_build_function_libraryconstant(char *,                                                        void (*)(mpfr_t,                                                                 mp_prec_t)) sollya_obj_t sollya_lib_libraryconstant_with_data(char *,                                                   void (*)(mpfr_t,                                                            mp_prec_t,                                                            void *),                                                   void *,                                                   void (*)(void *)) sollya_obj_t sollya_lib_build_function_libraryconstant_with_data(                                                   char *,                                                   void (*)(mpfr_t,                                                            mp_prec_t,                                                            void *),                                                   void *,                                                   void (*)(void *))

Usage:

libraryconstant(path) : string -> function

Description:

Example 1:

   > bashexecute("gcc -fPIC -Wall -c libraryconstantexample.c -I$HOME/.local/include");
   > bashexecute("gcc -shared -o libraryconstantexample libraryconstantexample.o -lgmp -lmpfr");
   > euler_gamma = libraryconstant("./libraryconstantexample");
   > prec = 20!;
   > euler_gamma;
   0.577215
   > prec = 100!;
   > euler_gamma;
   0.577215664901532860606512090082
   > midpointmode = on;
   Midpoint mode has been activated.
   > [euler_gamma];
   0.57721566490153286060651209008~2/4~
See also: bashexecute, externalproc, externaldata, externalplot, pi, library, evaluate
Go back to the list of commands