Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : Assert details
Please login or create an account


A collection of predicate (i.e., true–false) functions
(134 downloads for this version - 13553 downloads for all versions)
A more recent valid version with binaries for Scilab 5.2 exists: 1.3
Michael Baudin
Owner Organization
Michael Baudin
Allan Cornet
Creation Date
December 21, 2010
Source created on
Scilab 5.2.x
Binaries available on
The maintainer of this module has not provided binaries.

The goal of this toolbox is to provide functions to make testing easier. 
We emphasize the use of consistent tools for testing numerical issues,
with the goal of testing numerical algorithms more easily.
In particular, we provide a comparison function for two floating
point numbers, which allows to check that two numbers are "numerically almost
i.e. that the relative error is small.

The function of the assert module are designed to be used in Scilab unit tests
files (.tst files).

The functions allows to:
 * assert for true, equal statements,
 * assert that two floating point numbers are "close" (using a relative or
absolute tolerance).

Additionnaly, we can sort doubles complex numbers with a mixed relative/absolute
tolerance criteria.

The toolbox is based on macros.

To get an overview of the functions in this module, 
use :

help assert_overview


The following is a list of the current assert functions :
 * assert_checkalmostequal : Check that computed and expected are numerically
 * assert_checkequal : Check that computed and expected are equal.
 * assert_checktrue : Check that condition is true.
 * assert_checkfalse : Check that condition is false.
 * assert_checkfilesequal : Check two files are equal.
 * assert_checkerror : Check that the function has produced the correct error.
 * assert_generror : Generates an error.

and sorting functions :
 * assert_compare : The default comparison function used in the sort-merge.
 * assert_comparecomplex : Compare complex numbers with a tolerance.
 * assert_sort : A flexible sorting function.
 * assert_sortcomplex : Compare complex numbers with a tolerance.

and support functions :
 * assert_computedigits : Returns the number of significant digits in computed
 * assert_cond2reltol : Suggests a relative error, computed from the condition
 * assert_cond2reqdigits : Suggests the number of required digits, given the
condition number.
 * assert_csvread : Read data from a file or a string.
 * assert_csvwrite : Write data into a file or a string.

Files (1)
[217.39 kB]
Source code archive

News (0)
Comments (0)
Leave a comment
You must register and log in before leaving a comment.
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.