INT.CAM(1) User Contributed Perl Documentation INT.CAM(1) NNNNAAAAMMMMEEEE int.cam - a CAMILA library for small integers (- 32768..32767) SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS intAvg(l:INT-seq,p:INT):INT intSUM(l:INT-seq):INT intMIN(s:INT-set):INT intMAX(s:INT-set):INT intMUL(l:INT-seq):INT intPot(a:INT,b:INT):INT intSet2IncIntSeq(s:INT-set):INT-seq intSet2IntSeq(s:INT-set):INT-seq intFF2index(ff:A->INT):A-seq intAsRealRound(n:INT,i:INT):INT intAsReal2STR(i:INT,d:INT):STR DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN This library provides a few functions useful in simple integer arithmetics. Note that CAMILA type INT ranges from -32768 to 32767. For long integer arithmetics other data types are required. The informal semantics of the operators are as follows: intAvg(l:INT-seq,p:INT):INT _i_n_t_A_v_g(l,p) averages sequence l of integers, p adds decimal precision. intSUM(l:INT-seq):INT _i_n_t_S_U_M(l) sums sequence l of integers. intMIN(s:INT-set):INT _i_n_t_M_I_N(s) computes minimum of a set of INT. intMAX(s:INT-set):INT _i_n_t_M_I_N(s) computes maximum of a set of INT. 14/Oct/98 Last change: perl 5.004, patch 03 1 INT.CAM(1) User Contributed Perl Documentation INT.CAM(1) intMUL(l:INT-seq):INT _i_n_t_M_U_L(l) reduces sequence l of integers via multiplication. intPot(a:INT,b:INT):INT _i_n_t_P_o_t(a,b) computes a^b. intSet2IncIntSeq(s:INT-set):INT-seq _i_n_t_S_e_t_2_I_n_c_I_n_t_S_e_q(s) sorts s in INT-increasing order. intSet2IntSeq(s:INT-set):INT-seq _i_n_t_S_e_t_2_I_n_t_S_e_q(s) sorts s in INT-decreasing order. intFF2index(ff:A->INT):A-seq _i_n_t_F_F_2_i_n_d_e_x(ff) builds index of ff (range INT-increasing ordering). intAsRealRound(n:INT,i:INT):INT _i_n_t_A_s_R_e_a_l_R_o_u_n_d(n,i) regards n as a real number with i decimal places and rounds it. intAsReal2STR(i:INT,d:INT):STR _i_n_t_A_s_R_e_a_l_2_S_T_R(n,i) regards n as a real number with i decimal places and converts into to a string. SSSSEEEEEEEE AAAALLLLSSSSOOOO No include commands found. AAAAUUUUTTTTHHHHOOOORRRR J.N. Oliveira (jno@di.uminho.pt) 14/Oct/98 Last change: perl 5.004, patch 03 2