C Functions

SymbolicC supports working with C functions, as described in this section.

Defining Functions

First, you need to load the package.

In[7]:=
Click for copyable input

Now, you can create a C function with CFunction.

In[9]:=
Click for copyable input
Out[9]=

You can give a list as the type specification if you need type qualifiers.

In[10]:=
Click for copyable input
Out[10]=

Calling Functions

First, you need to load the package.

In[7]:=
Click for copyable input

Now, you can call a C function with CCall.

In[12]:=
Click for copyable input
Out[12]=

Standard Math Operators

First, you need to load the package.

In[1]:=
Click for copyable input

SymbolicC provides a full range of the standard C math operators. These generate function calls, as shown in the following.

In[2]:=
Click for copyable input
Out[2]=

For some standard math operators there is no corresponding Wolfram Language function. In this case a string is used, as shown below.

In[3]:=
Click for copyable input
Out[3]=

The full list of standard math operators is given below, showing the name in the Wolfram Language and the output C name.

ArcCosacos
ArcSinasin
ArcTanatan (one argument)
ArcTanatan2 (two arguments)
Ceilingceil
Coscos
Coshcosh
Expexp
Absfabs
Floorfloor
"frexp"frexp
"ldexp"ldexp
Loglog
"log10"log10
"modf"modf
Powerpow
Sinsin
Sinhsinh
Sqrtsqrt
Tantan
Tanhtanh

Wolfram Language function names and the corresponding standard math functions.