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

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

Serving Software Downloads in 956 Categories, Downloaded 50.248.515 Times

Libeval 1.0.7

  Date Added: August 14, 2010  |  Visits: 904

Libeval

Report Broken Link
Printer Friendly Version


Product Homepage
Download (95 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
USER REVIEWS
More Reviews or Write Review


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  -  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  -  readline C++ wrapper 0.3
readline C++ wrapper simplifies usage of the readline and history libraries for C++ programmers..
204.8 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  -  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  -  Inline::C 0.44
Inline::C is a Perl module that can Write Perl Subroutines in C. Inline::C is a module that allows you to write Perl subroutines in C. Since version 0.30 the Inline module supports multiple programming languages and each language has its own...
92.16 KB  
Libraries  -  Better String Library 7222006
Better String Library is an abstraction of a string data type which is superior to the C library char buffer string type and C++s std::string. The library is totally stand alone, portable (known to work with gcc/g++, MSVC++, Intel C++, WATCOM...
112.64 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
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  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.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...
3.88 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