home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / b / baswiz19.zip / BW$BAS.ZIP / COSHD.BAS < prev    next >
BASIC Source File  |  1993-01-29  |  788b  |  23 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |        BASWIZ  Copyright (c) 1990-1993  Thomas G. Hanlin III         |
  4. '   |                                                                      |
  5. '   |                      The BASIC Wizard's Library                      |
  6. '   |                                                                      |
  7. '   +----------------------------------------------------------------------+
  8.  
  9.    DEFDBL A-Z
  10.  
  11. FUNCTION CosHD# (Nr AS DOUBLE)
  12.    IF Nr < 0# THEN
  13.       N = -Nr
  14.    ELSE
  15.       N = Nr
  16.    END IF
  17.    IF N > 21# THEN
  18.       CosHD# = EXP(N) / 2#
  19.    ELSE
  20.       CosHD# = (EXP(N) + EXP(-N)) / 2#
  21.    END IF
  22. END FUNCTION
  23.