Changeset dd2aa36 in git for Singular/LIB/general.lib
- Timestamp:
- Jun 21, 1999, 7:34:15 PM (24 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 1354bda55ee798716af916942e769a15d6728278
- Parents:
- d1f46162556b5ef35ebcf98cea94b1706df61795
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/general.lib
rd1f461 rdd2aa36 1 // $Id: general.lib,v 1.1 2 1999-06-18 13:47:27 greuelExp $1 // $Id: general.lib,v 1.13 1999-06-21 17:34:15 Singular Exp $ 2 2 //system("random",787422842); 3 3 //GMG, last modified 18.6.99 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: general.lib,v 1.1 2 1999-06-18 13:47:27 greuelExp $";6 version="$Id: general.lib,v 1.13 1999-06-21 17:34:15 Singular Exp $"; 7 7 info=" 8 8 LIBRARY: general.lib PROCEDURES OF GENERAL TYPE … … 13 13 factorial(n[,../..]); n factorial (=n!) (type int), [type string/number] 14 14 fibonacci(n[,p]); nth Fibonacci number [char p] 15 kmemory([n ]);active [allocated] memory in kilobyte15 kmemory([n[,v]]); active [allocated] memory in kilobyte 16 16 killall(); kill all user-defined variables 17 17 number_e(n); compute exp(1) up to n decimal digits … … 231 231 232 232 proc kmemory (list #) 233 "USAGE: kmemory([n ]); n = int233 "USAGE: kmemory([n,[v]]); n = int 234 234 RETURN: memory in kilobyte of type int 235 235 n=0: memory used by active variables (same as no parameters) … … 237 237 n=2: difference between top and init memory adress (sbrk memory) 238 238 n!=0,1,2: 0 239 DISPLAY: detailed information about allocated and used memory if n!=0,1,2239 DISPLAY: detailed information about allocated and used memory if v!=0 240 240 NOTE: kmemory uses internal function 'memory' to compute kilobyte, and 241 241 is the same as 'memory' for n!=0,1,2 … … 244 244 { 245 245 int n; 246 int verb; 246 247 if (size(#) != 0) 247 248 { 248 249 n=#[1]; 250 if (size(#) >1) 251 { verb=#[2]; } 249 252 } 250 253 251 if ( n==0) 252 { dbprint(printlevel-voice+3, 253 "// memory used, at the moment, by active variables (kilobyte):"); } 254 if ( n==1 ) 255 { dbprint(printlevel-voice+3, 256 "// total memory allocated, at the moment, by SINGULAR (kilobyte):"); } 254 if ( verb != 0) 255 { 256 if ( n==0) 257 { dbprint(printlevel-voice+3, 258 "// memory used, at the moment, by active variables (kilobyte):"); } 259 if ( n==1 ) 260 { dbprint(printlevel-voice+3, 261 "// total memory allocated, at the moment, by SINGULAR (kilobyte):"); } 262 } 257 263 return ((memory(n)+1023)/1024); 258 264 } … … 260 266 { "EXAMPLE:"; echo = 2; 261 267 kmemory(); 262 kmemory(1 );268 kmemory(1,1); 263 269 } 264 270 ///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.