Changeset d09118 in git for factory/cf_char.cc


Ignore:
Timestamp:
Aug 18, 2008, 12:36:24 PM (16 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
9539de640ccfecf479ba6edae20d859c36821801
Parents:
6b55c7daa25948ba8f1c11c48911c50daca86b98
Message:
*hannes: limits for char.


git-svn-id: file:///usr/local/Singular/svn/trunk@10998 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_char.cc

    r6b55c7 rd09118  
    11/* emacs edit mode for this file is -*- C++ -*- */
    2 /* $Id: cf_char.cc,v 1.7 2002-03-08 10:31:45 Singular Exp $ */
     2/* $Id: cf_char.cc,v 1.8 2008-08-18 10:36:24 Singular Exp $ */
    33
    44#include <config.h>
     
    2525void setCharacteristic( int c )
    2626{
    27     if ( c == 0 ) {
    28         theDegree = 0;
    29         CFFactory::settype( IntegerDomain );
    30         theCharacteristic = 0;
     27    if ( c == 0 )
     28    {
     29        theDegree = 0;
     30        CFFactory::settype( IntegerDomain );
     31        theCharacteristic = 0;
    3132    }
    32     else {
    33         theDegree = 1;
    34         CFFactory::settype( FiniteFieldDomain );
    35         theCharacteristic = c;
    36         ff_big = c > cf_getSmallPrime( cf_getNumSmallPrimes()-1 );
    37         ff_setprime( c );
    38         resetFPT();
     33    else
     34    {
     35        theDegree = 1;
     36        CFFactory::settype( FiniteFieldDomain );
     37        theCharacteristic = c;
     38        ff_big = c > cf_getSmallPrime( cf_getNumSmallPrimes()-1 );
     39#ifdef SINGULAR
     40        extern int errorreported;
     41        void    WerrorS(const char *s);
     42        if (!errorreported && (c > 536870909)) WerrorS("characteristic too large(max is 2^29)");
     43#endif
     44        ff_setprime( c );
     45        resetFPT();
    3946    }
    4047}
Note: See TracChangeset for help on using the changeset viewer.