home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1999 April / CD_Shareware_Magazine_31.iso / WIN95 / INTERNET / h12395co.exe / data.1 / math.hei < prev    next >
Encoding:
Text File  |  1997-07-29  |  2.3 KB  |  60 lines

  1. <includeonce
  2. //     Filename: math.hei version 1.0
  3. // Release date: March 3rd, 1997
  4. //    File Type: heitml Math Library
  5. // 
  6. // (C) 1996-97 H.E.I. GmbH and suppliers all rights reseved
  7. // 
  8. // Redistribution and use in source and binary forms, with or without
  9. // modification, are permitted provided that the following conditions
  10. // are met:
  11. // 1. Redistributions of source code must retain the above copyright
  12. //    notice, this list of conditions and the following disclaimer.
  13. // 2. Redistributions in binary form must reproduce the above copyright
  14. //    notice, this list of conditions and the following disclaimer in the
  15. //    documentation and/or other materials provided with the distribution.
  16. // 3. Neither the name of H.E.I. GmbH nor the names of its contributors
  17. //    may be used to endorse or promote products derived from this software
  18. //    without specific prior written permission.
  19. // 4. The complete licensing conditions of heitml apply also to this file,
  20. //    be sure to have read and accepted these conditions before using this
  21. //    file. This file may be used and modified freely in conjunction with 
  22. //    a valid heitml license.
  23. // 
  24. // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  25. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  26. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  27. // IN NO EVENT SHALL THE H.E.I. OR CONTRIBUTORS BE LIABLE FOR ANY
  28. // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  30. // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  31. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  32. // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  33. // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  34. // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35.  
  36. def   abs x;
  37.      if 0 < x; return x;
  38.      else return x - (2 * x);
  39.      /if;
  40. /def
  41.  
  42. def   sqr x;   return x * x;      /def
  43. def  cube x;   return x * x * x;  /def
  44.  
  45. def power x y;
  46.      i = 1; a = x;
  47.      while i <  y; a = a * x; i = i + 1; /while; 
  48.   return a;  
  49. /def
  50.  
  51.  
  52. def log10 x;
  53.      l = 0;
  54.      while 10 <= x;
  55.     x = x / 10;
  56.         l = l + 1;
  57.      /while;
  58.  return l;
  59. /def>
  60.