Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 30.076.228 Times

Libeval 1.0.7

  Date Added: August 14, 2010  |  Visits: 674

Libeval

Report Broken Link
Printer Friendly Version


Product Homepage
Download (72 downloads)

Libeval provides simple means of evaluating simple arithmetic expressions involving literal numeric values, variables and functions using the addition (+), subtraction (-), multiplication (*), division (/), modulo division (), exponentiation (^), sign (+-), percentag (%) and grouping (()) operators. Libeval provides a means of setting and interrogating variables, defining functions and converting error codes into human readable strings. A number of predefined functions are included with libeval that wrap the existing standard C library math functions. You can evaluate an expression by calling the eval() function. eval() takes two parameters, the expression to evaluate (as a simple C string) and a reference to a double precision float in which to put the result. If eval() encounters an error it returns a non-zero value, otherwise, if everything went well, it returns zero. The error code returned by eval() can be converted into a human readable string by the eval_error() function. eval_error() takes one parameter, the error code returned by eval(),and returns a constant string describing the error. Variables can be manipulated with the eval_set_var() and eval_get_var() functions. eval_set_var() sets the named variable to the specified double precision value. eval_set_var() takes two parameters, the name of the variable to set as a simple C string, and the double precision float value to set the variable to. it returns 0 (zero) on success, non-zero on failure. eval_get_var() gets the value of the named variable. eval_get_var() takes two parameters, the name of the variable as a simple C string and a reference to a double precision float in which to store the variables value. it returns 0 (zero) on success, non-zero on failure. Functions can be defined with the eval_def_fn() function, which takes the name of the function as a simple C string, a pointer to a C function implementing the function, a pointer to a block of custom storage for use by the function and the number of arguments taken by the function. The prototype for the implementation function is: int fn(int args, double *arg, double *rv, void *data); The first two parameters (args and arg) are similar to the standard parameters to the main() function in C, the args parameter indicates how many elements are the argument list, and arg is the argument list itself. The third parameter (rv) is the return value from the function. The last parameter (data) is the custome storage block passed in when the function was defined. If you specify a positive value (including zero) as the number of arguments for a function, libeval will only all the function to be called with exactly that number of parameters. If you specify a -1 (negative one) for the number of arguments, the function can be called with any number of parameters. The following functions are predefined: abs(x) absolute value of x int(x) integer part of x round(x) round x to nearest integer trunc(x) truncate x (same as int(x)) floor(x) round x to nearest lesser integer ceil(x) round x to nearest greater integer sin(x) sine of x (radians) cos(x) cosine of x (radians) tan(x) tangent of x (radians) asin(x) arc sine of x (radians) acos(x) arc cosine of x (radians) atan(x) arc tangent of x (radians) sinh(x) hyperbolic sine of x (radians) cosh(x) hyperbolic cosine of x (radians) tanh(x) hyperbolic tangent of x (radians) asinh(x) hyperbolic arc sine of x (radians) acosh(x) hyperbolic arc cosine of x (radians) atanh(x) hyperbolic arc tangent of x (radians) deg(x) convert radians to degrees rad(x) convert degrees to radians ln(x) natural logarithm of x log(x) base 10 logarithm of x sqrt(x) square root of x exp(x) e to x power rand() random number between 0.0 and 1.0 fact(x) factorial of x (or gamma(x) if x is non-integer) sum(...) sum of the arguments min(...) minimum value in arguments max(...) maximum value in arguments avg(...) average of arguments med(...) median of arguments var(...) variance of arguments std(...) standard deviation of arguments Finally, you can get a set of bookkeepping information about the eval_expr libray with the eval_info() function. eval_info() takes nine parmaeters: three references to integer values for the version, revision and build numbers of the current eval_expr library, and three pairs of buffer address and buffer size limit for authors name, copyright info and license info. You can use libeval by including the libeval header in your program source #include and then by linking your program against the libeval library gcc -o myprog myprog.c -leval Whats New in This Release: - A bug in the var() function and version string construction were fixed..

Requirements: No special requirements
Platforms: Linux
Keyword: C String Double Precision Eval Function It Returns Libeval Libraries Programming Radians Simple Value
Users rating: 0/10

License: Freeware Size: 27.65 KB
LIBEVAL RELATED
Development Tools  -  Histogram Binwidth Optimization 1.0
function [optN, C, N] = sshist(x,N) [optN, C, N] = sshist(x,N) Function `sshist' returns the optimal number of bins in a histogram used for density estimation. Optimization principle is to minimize expected L2 loss function between the histogram...
10 KB  
Libraries  -  FireRPC 0.9.13
libfirerpc is a library that provides an easy interface for C programs to make remote function queries via the XML RPC protocol. It supports SSL/TLS, HTTP authentication, HTTP 1.1 persistent connections and pipelining. It also supports POST data...
307.2 KB  
Libraries  -  Mail::QmailRemoteXS 1.2
Mail::QmailRemoteXS is a lightweight C-code (XS) SMTP send function based on Qmails qmail-remote. SYNOPSIS use Mail::QmailRemoteXS; $ret =...
256 KB  
Libraries  -  Convert::Cyr
Convert::Cyr, chcp is a Perl module for change cyrillic code page of a text. SYNOPSIS use Convert::Cyr qw(chcp); $converted_string=chcp($string, $maxlen, $from, $to); ABSTRACT Convert::Cyr, chcp - change cyrillic code page of a text....
5.12 KB  
Libraries  -  macstl 0.3.1
macstl is a C++ header library designed to bring the world of generic programming to the Macintosh, and deliver the surprising speed of SIMD in an intuitive cross-platform package. For example, a simple loop calculating a trigonometric function...
174.08 KB  
Libraries  -  Inline::CPR 0.12
Inline::CPR is C Perl Run. Embed Perl in C, ala Inline SYNOPSIS #!/usr/local/bin/cpr int main(void) { printf("Hello World, Im running under Perl version %sn", CPR_eval("use Config; $Config{version}") ); return 0; } Is it C? Is it...
7.17 KB  
Libraries  -  libbsl 0.9.1
libbsl (Basic System Library) is a powerful, easy to use and fully thread safe C++ template class library for frequently recurring (machine/OS oriented) programming problems. All fundamental objects in libbsl are freely copyable and shareable...
1.04 MB  
Libraries  -  readline C++ wrapper 0.3
readline C++ wrapper simplifies usage of the readline and history libraries for C++ programmers..
204.8 KB  
Libraries  -  Multiple-Precision Floating-Point Library 2.2.0
The MPFR library is a C library for multiple-precision floating-point computations with exact rounding (also called correct rounding). It is based on the GMP multiple-precision library. The main goal of MPFR is to provide a library for...
942.08 KB  
Libraries  -  Socket6 0.19
Socket6 is a Perl module for IPv6 related part of the C socket.h defines and structure manipulators. SYNOPSIS use Socket; use Socket6; @res = getaddrinfo(hishost.com, daytime, AF_UNSPEC, SOCK_STREAM); $family = -1; while (scalar(@res) >=...
55.3 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.12.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
2.73 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB