This file is part of IDEAS, which uses RePEc data


[ Papers | Articles | Software | Books | Chapters | Authors | Institutions | JEL Classification | NEP reports | Search | New papers by email | Author registration | Rankings | Volunteers | FAQ | Blog | Help! ]

FTEST: Octave function test routine

Author info | Abstract | Publisher info | Download info | Related research | Statistics
Author Info
Paul Kienzle ()
Abstract

I wrote ftest, which extracts lines starting with ##! and evaluates them with eval(). It doesn't cope with syntax errors elegantly. E.g., usage: r = mod(x,y) Compute modulo function, handling negative number correctly; i.e., mod(-1,3) is 2, not -1 as rem(-1,3) returns. function r=mod(x,y) if nargin != 2, usage("r=mod(x,y)"); endif r = x - floor(x./y).*y; endfunction ! if mod(5,3) != 2, disp("mod fails for positive a"); endif ! if mod(-5,3) != 1, disp("mod fails for negative a"); endif ! if mod(0,3) != 0, disp("mod fails for a=0"); endif ! if !isempty(mod([],[])), disp("mod fails for empty"); endif ! if any(mod([-5 5 0],[3 3 3]) != [1 2 0]), ! disp("mod fails for columns"); endif ! if any(mod([-5 5 0]',[3 3 3]') != [1 2 0]'), ! disp("mod fails for rows"); endif ! if any(any(mod([-5 5; 0 3],[3 3 ; 3 1]) != [1 2 ; 0 0])), ! disp("mod fails for matrices"); endif

Download Info
To download:

If you experience problems downloading a file, check if you have the proper application to view it first. Information about this may be contained in the File-Format links below. In case of further problems read the IDEAS help file. Note that these files are not on the IDEAS site. Please be patient as the files may be large.

File URL: http://fmwww.bc.edu/repec/bococt/ftest.cc
File Format: text/plain
File Function: program code
Download Restriction: no

Publisher Info
Software component provided by in its series Octave codes with number C042505.

Download reference. The following formats are available: HTML, plain text, BibTeX, RIS (EndNote), ReDIF
Size:
Programming language: Octave
Requires: Octave
Date of creation: 16 Apr 2000
Date of revision:
Handle: RePEc:cod:octave:c042505

Contact details of provider:

For technical questions regarding this item, or to correct its listing, contact: ().

Related research
Keywords:

Statistics
Access and download statistics

Did you know? Authors registered on the RePEc Author Service receive monthly emails with details about downloads and abstract views of their works.

This page was last updated on 2008-8-16.


This information is provided to you by IDEAS at the Department of Economics, College of Liberal Arts and Sciences, University of Connecticut using RePEc data on a server sponsored by the Society for Economic Dynamics.