source: git/factory/cf_util.cc @ 173e86

fieker-DuValspielwiese
Last change on this file since 173e86 was b973c0, checked in by Jens Schmidt <schmidt@…>, 27 years ago
#include <config.h> added git-svn-id: file:///usr/local/Singular/svn/trunk@136 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 463 bytes
Line 
1// emacs edit mode for this file is -*- C++ -*-
2// $Id: cf_util.cc,v 1.1 1997-04-07 16:14:18 schmidt Exp $
3
4/*
5$Log: not supported by cvs2svn $
6Revision 1.0  1996/05/17 10:59:45  stobbe
7Initial revision
8
9*/
10
11#include <config.h>
12
13#include "assert.h"
14
15#include "cf_defs.h"
16#include "cf_util.h"
17
18
19int ipower ( int b, int m )
20{
21    int prod = 1;
22
23    while ( m != 0 ) {
24        if ( m % 2 != 0 )
25            prod *= b;
26        m /= 2;
27        if ( m != 0 )
28            b *= b;
29    }
30    return prod;
31}
Note: See TracBrowser for help on using the repository browser.