home *** CD-ROM | disk | FTP | other *** search
- <includeonce
- // Filename: math.hei version 1.0
- // Release date: March 3rd, 1997
- // File Type: heitml Math Library
- //
- // (C) 1996-97 H.E.I. GmbH and suppliers all rights reseved
- //
- // Redistribution and use in source and binary forms, with or without
- // modification, are permitted provided that the following conditions
- // are met:
- // 1. Redistributions of source code must retain the above copyright
- // notice, this list of conditions and the following disclaimer.
- // 2. Redistributions in binary form must reproduce the above copyright
- // notice, this list of conditions and the following disclaimer in the
- // documentation and/or other materials provided with the distribution.
- // 3. Neither the name of H.E.I. GmbH nor the names of its contributors
- // may be used to endorse or promote products derived from this software
- // without specific prior written permission.
- // 4. The complete licensing conditions of heitml apply also to this file,
- // be sure to have read and accepted these conditions before using this
- // file. This file may be used and modified freely in conjunction with
- // a valid heitml license.
- //
- // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
- // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- // IN NO EVENT SHALL THE H.E.I. OR CONTRIBUTORS BE LIABLE FOR ANY
- // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
- // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
- // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- def abs x;
- if 0 < x; return x;
- else return x - (2 * x);
- /if;
- /def
-
- def sqr x; return x * x; /def
- def cube x; return x * x * x; /def
-
- def power x y;
- i = 1; a = x;
- while i < y; a = a * x; i = i + 1; /while;
- return a;
- /def
-
-
- def log10 x;
- l = 0;
- while 10 <= x;
- x = x / 10;
- l = l + 1;
- /while;
- return l;
- /def>
-