a68g-lib.h

     
   1  //! @file a68g-lib.h
   2  //! @author J. Marcel van der Veer
   3  
   4  //! @section Copyright
   5  //!
   6  //! This file is part of Algol68G - an Algol 68 compiler-interpreter.
   7  //! Copyright 2001-2024 J. Marcel van der Veer [algol68g@xs4all.nl].
   8  
   9  //! @section License
  10  //!
  11  //! This program is free software; you can redistribute it and/or modify it 
  12  //! under the terms of the GNU General Public License as published by the 
  13  //! Free Software Foundation; either version 3 of the License, or 
  14  //! (at your option) any later version.
  15  //!
  16  //! This program is distributed in the hope that it will be useful, but 
  17  //! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
  18  //! or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
  19  //! more details. You should have received a copy of the GNU General Public 
  20  //! License along with this program. If not, see [http://www.gnu.org/licenses/].
  21  
  22  //! @section Synopsis
  23  //!
  24  //! Internal math routines.
  25  
  26  #if !defined (__A68G_LIB_H__)
  27  #define __A68G_LIB_H__
  28  
  29  #define A68_INVALID(c)\
  30    if (c) {\
  31      errno = EDOM;\
  32      return 0;\
  33    }
  34  
  35  #define A68_OVERFLOW(c)\
  36    if (c) {\
  37      errno = ERANGE;\
  38      return 0;\
  39    }
  40  
  41  #define A68_MAX_FAC 170
  42  
  43  INT_T a68_add_int (INT_T, INT_T);
  44  INT_T a68_mod_int (INT_T, INT_T);
  45  INT_T a68_mul_int (INT_T, INT_T);
  46  INT_T a68_m_up_n (INT_T, INT_T);
  47  INT_T a68_over_int (INT_T, INT_T);
  48  INT_T a68_round (REAL_T);
  49  INT_T a68_sub_int (INT_T, INT_T);
  50  REAL_T a68_abs_real (REAL_T);
  51  REAL_T a68_acosdg_real (REAL_T);
  52  REAL_T a68_acosh_real (REAL_T);
  53  REAL_T a68_acotdg_real (REAL_T);
  54  REAL_T a68_acot_real (REAL_T);
  55  REAL_T a68_acsc_real (REAL_T);
  56  REAL_T a68_acscdg_real (REAL_T);
  57  REAL_T a68_asec_real (REAL_T);
  58  REAL_T a68_asecdg_real (REAL_T);
  59  REAL_T a68_asindg_real (REAL_T);
  60  REAL_T a68_asinh_real (REAL_T);
  61  REAL_T a68_atan2_real (REAL_T, REAL_T);
  62  REAL_T a68_atandg_real (REAL_T);
  63  REAL_T a68_atanh_real (REAL_T);
  64  REAL_T a68_beta_real (REAL_T, REAL_T);
  65  REAL_T a68_choose_real (INT_T, INT_T);
  66  REAL_T a68_cas_real (REAL_T);
  67  REAL_T a68_cosdg_real (REAL_T);
  68  REAL_T a68_cospi_real (REAL_T);
  69  REAL_T a68_cot_realdg_real (REAL_T);
  70  REAL_T a68_cot_realpi (REAL_T);
  71  REAL_T a68_cot_real (REAL_T);
  72  REAL_T a68_csc_real (REAL_T);
  73  REAL_T a68_cscdg_real (REAL_T);
  74  REAL_T a68_sec_real (REAL_T);
  75  REAL_T a68_secdg_real (REAL_T);
  76  REAL_T a68_div_int (INT_T, INT_T);
  77  REAL_T a68_exp_real (REAL_T);
  78  REAL_T a68_fact_real (INT_T);
  79  REAL_T a68_fdiv_real (REAL_T, REAL_T);
  80  REAL_T a68_hypot_real (REAL_T, REAL_T);
  81  REAL_T a68_int_real (REAL_T);
  82  REAL_T a68_inverfc_real (REAL_T);
  83  REAL_T a68_inverf_real (REAL_T);
  84  REAL_T a68_ln1p_real (REAL_T);
  85  REAL_T a68_ln1p_real (REAL_T);
  86  REAL_T a68_ln_beta_real (REAL_T, REAL_T);
  87  REAL_T a68_ln_choose_real (INT_T, INT_T);
  88  REAL_T a68_ln_fact_real (INT_T);
  89  REAL_T a68_ln_real (REAL_T);
  90  REAL_T a68_max_real (REAL_T, REAL_T);
  91  REAL_T a68_min_real (REAL_T, REAL_T);
  92  REAL_T a68_nan_real (void);
  93  REAL_T a68_neginf_double_real (void);
  94  REAL_T a68_posinf_real (void);
  95  REAL_T a68_psi_real (REAL_T);
  96  REAL_T a68_sign_real (REAL_T);
  97  REAL_T a68_sindg_real (REAL_T);
  98  REAL_T a68_sinpi_real (REAL_T);
  99  REAL_T a68_tandg_real (REAL_T);
 100  REAL_T a68_tanpi_real (REAL_T);
 101  REAL_T a68_x_up_n_real (REAL_T, INT_T);
 102  REAL_T a68_x_up_y (REAL_T, REAL_T);
 103  REAL_T a68_beta_inc_real (REAL_T, REAL_T, REAL_T);
 104  DOUBLE_T a68_beta_inc_double (DOUBLE_T, DOUBLE_T, DOUBLE_T);
 105  DOUBLE_T a68_cot_double (DOUBLE_T);
 106  DOUBLE_T a68_csc_double (DOUBLE_T);
 107  DOUBLE_T a68_cscdg_double (DOUBLE_T);
 108  DOUBLE_T a68_sec_double (DOUBLE_T);
 109  DOUBLE_T a68_secdg_double (DOUBLE_T);
 110  DOUBLE_T a68_acot_double (DOUBLE_T);
 111  DOUBLE_T a68_acsc_double (DOUBLE_T);
 112  DOUBLE_T a68_acscdg_double (DOUBLE_T);
 113  DOUBLE_T a68_asec_double (DOUBLE_T);
 114  DOUBLE_T a68_asecdg_double (DOUBLE_T);
 115  DOUBLE_T a68_sindg_double (DOUBLE_T);
 116  DOUBLE_T a68_cas_double (DOUBLE_T);
 117  DOUBLE_T a68_cosdg_double (DOUBLE_T);
 118  DOUBLE_T a68_tandg_double (DOUBLE_T);
 119  DOUBLE_T a68_asindg_double (DOUBLE_T);
 120  DOUBLE_T a68_acosdg_double (DOUBLE_T);
 121  DOUBLE_T a68_atandg_double (DOUBLE_T);
 122  DOUBLE_T a68_cotdg_double (DOUBLE_T);
 123  DOUBLE_T a68_acotdg_double (DOUBLE_T);
 124  DOUBLE_T a68_sinpi_double (DOUBLE_T); 
 125  DOUBLE_T a68_cospi_double (DOUBLE_T); 
 126  DOUBLE_T a68_tanpi_double (DOUBLE_T);
 127  DOUBLE_T a68_cotpi_double (DOUBLE_T);
 128  
 129  #endif