Changeset ca41246 in git
- Timestamp:
- Apr 11, 2002, 4:46:54 PM (21 years ago)
- Branches:
- (u'spielwiese', '91fdef05f09f54b8d58d92a472e9c4a43aa4656f')
- Children:
- 6d37e82849724a2ee9462403f0b027ac1d23c175
- Parents:
- 6246289a407013267ca92abd09e79c6a44aba2b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/general.lib
r624628 rca41246 1 1 //GMG, last modified 18.6.99 2 2 //anne, added deleteSublist and watchdog 12.12.2000 3 /////////////////////////////////////////////////////////////////////////////// 4 version="$Id: general.lib,v 1.41 2001-11-05 16:05:48 pfister Exp $"; 3 //eric, added absValue 11.04.2002 4 /////////////////////////////////////////////////////////////////////////////// 5 version="$Id: general.lib,v 1.42 2002-04-11 14:46:54 westenb Exp $"; 5 6 category="General purpose"; 6 7 info=" … … 10 11 A_Z(\"a\",n); string a,b,... of n comma separated letters 11 12 ASCII([n,m]); string of printable ASCII characters (number n to m) 13 absValue(c); absolute value of c 12 14 binomial(n,m[,../..]); n choose m (type int), [type string/type number] 13 15 deleteSublist(iv,l); delete entries given by iv from list l … … 135 137 ASCII(42); 136 138 ASCII(32,126); 139 } 140 /////////////////////////////////////////////////////////////////////////////// 141 142 proc absValue(def c) 143 "USAGE: absValue(c); c int, number or poly 144 RETURN: absValue(c); the absolute value of c 145 NOTE: absValue(c)=c if c>=0; absValue=-c if c<=0. 146 @* So the function can be applied to any type, for which comparison 147 @* operators are defined. 148 SEE ALSO: boolean expressions 149 EXAMPLE: example absValue; shows an example 150 " 151 { 152 if (c>=0) { return(c); } 153 else { return(-c); } 154 } 155 example 156 { "EXAMPLE:"; echo = 2; 157 ring r1 = 0,x,dp; 158 absValue(-2002); 159 160 poly f=-4; 161 absValue(f); 137 162 } 138 163 ///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.