Post a reply
Username:
Note:If not registered, provide any username. For more comfort, register here.
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) :( :o :shock: :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen:
Font size:
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation of post
To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.
Confirmation code:
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.
   

Topic review - Long integers in Singular
Author Message
  Post subject:   Reply with quote
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)
Post Posted: Thu Sep 22, 2005 6:12 pm
  Post subject:  Long integers in Singular  Reply with quote
Hi.

Is there any way to define and use long integer numbers? Say 30 digits?
Post Posted: Thu Sep 22, 2005 6:05 pm


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