Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Long integers in Singular
PostPosted: Thu Sep 22, 2005 6:05 pm 
Hi.

Is there any way to define and use long integer numbers? Say 30 digits?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Thu Sep 22, 2005 6:12 pm 

Joined: Wed Sep 21, 2005 1:27 pm
Posts: 10
Location: Kaiserslautern, Germany
Long integers are available as coefficients of polynomials. Define a ring:
Code:
> ring r=0,x,dp;

Then all objects of type number are arbitrary long integers resp. rationals:
Code:
> number n=12345678901234567890;
> number m=n^100;
> size(m);     // number of digits of m
204


For some applications also the use of "long floats" as polynomial coefficients could be appropriate:
Code:
> ring rr=(real,30),x,dp; // float with 30 digits
> rr;
//   characteristic : 0 (real:30 digits, additional 30 digits)
//   number of vars : 1
//        block   1 : ordering dp
//                  : names    x
//        block   2 : ordering C
> number n=12345678901234567890;
> n^100;
0.141741727427773144141199473044e+1910


Hope that answers your question.

Christoph Lossen
(Singular Team)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

It is currently Fri May 13, 2022 11:00 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group