Changeset ffde366 in git


Ignore:
Timestamp:
Jun 13, 2006, 12:21:01 PM (18 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b52fc4b2495505785981d640dcf7eb3e456778ef')
Children:
92fab96123fabea4a561ea96ce147ddd6baa9dff
Parents:
7523a7be6875be53eb42a20b61a5e091af63d18a
Message:
*hannes: bigint <- number


git-svn-id: file:///usr/local/Singular/svn/trunk@9203 2c84dea3-7e68-4137-9b89-c4e89433aadc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/ipconv.cc

    r7523a7 rffde366  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipconv.cc,v 1.29 2006-05-29 16:10:50 Singular Exp $ */
     4/* $Id: ipconv.cc,v 1.30 2006-06-13 10:21:00 Singular Exp $ */
    55/*
    66* ABSTRACT: automatic type conversions
     
    1818#include "numbers.h"
    1919#include "modulop.h"
     20#include "longrat.h"
    2021#include "longalg.h"
    2122#include "matpol.h"
     
    186187}
    187188
     189static void * iiN2BI(void *data)
     190{
     191  number n,i; i=(number)data;
     192  if (rField_is_Zp())     n=nlInit((int)(long)data);
     193  else if (rField_is_Q())
     194  {
     195    if ((SR_HDL(i)&SR_INT)==SR_INT) n=nlInit((int)SR_TO_INT(i));
     196    else if (i->s==3)               n=nlCopy(i);
     197    else { WerrorS("cannot convert to bigint"); n=nlInit(0); }
     198  }
     199  else { WerrorS("cannot convert to bigint"); n=nInit(0); }
     200  return (void *)n;
     201}
    188202static void * iiN2P(void *data)
    189203{
     
    281295//  number -> matrix
    282296   { NUMBER_CMD,      MATRIX_CMD,     iiN2Ma  , NULL },
     297//  number -> bigint
     298   { NUMBER_CMD,      BIGINT_CMD,     iiN2P  , NULL },
    283299//  number -> ideal
    284300//  number -> vector
  • Singular/mpsr.h

    r7523a7 rffde366  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr.h,v 1.21 2005-07-28 17:25:25 Singular Exp $ */
     4/* $Id: mpsr.h,v 1.22 2006-06-13 10:21:01 Singular Exp $ */
    55/***************************************************************
    66 *
     
    256256#endif // MPSR_DEBUG
    257257
    258 // those defines are from longrat.cc
    259 // It would be nice if we could include them, but they are not defined
    260 // in a header file
    261 
    262 #define SR_HDL(A) ((long)(A))
    263 #define INT_TO_SR(INT)  ((number) (((long)INT << 2) + SR_INT))
    264 #define SR_TO_INT(SR)   (((long)SR) >> 2)
    265 
    266258union nf
    267259{
  • kernel/longrat.h

    r7523a7 rffde366  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: longrat.h,v 1.3 2006-05-02 16:25:17 Singular Exp $ */
     6/* $Id: longrat.h,v 1.4 2006-06-13 10:21:01 Singular Exp $ */
    77/*
    88* ABSTRACT: computation with long rational numbers
     
    1313
    1414typedef MP_INT lint;
     15
     16#define SR_HDL(A) ((long)(A))
    1517
    1618#define SR_INT    1L
Note: See TracChangeset for help on using the changeset viewer.