# Singular

 Page 1 of 1 [ 2 posts ]
 Print view | E-mail friend Previous topic | Next topic
Author Message
 Post subject: get ring precision (number of digits) valuePosted: Sun Jul 31, 2016 2:39 pm
assuming that somewhere a ring is declared (by ot hers), lets say

Code:
ring R = (real,55,57),x,dp;

is there a Singular function to get the number of digits like

Code:
int R_digits ;
int R_restdigits;
R_digits = digits(R);
R_restdigits = restdigits(R);

?

Top

 Post subject: Re: get ring precision (number of digits) valuePosted: Wed Aug 03, 2016 1:49 pm

Joined: Sat Apr 16, 2016 7:25 pm
Posts: 8
Apologies if I misunderstood your question,
If you want to recover details of declared ring, use ringlist command. For example,

Code:
ring r = (real,55,57),x,dp;
ringlist(r);  //Displays information regarding current ring as array of arrays.

Now,
int R_digits =ringlist(r)[1][2][1];     //55
int R_restdigits = ringlist(r)[1][2][2];    //57

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 2 posts ]

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

 It is currently Thu Oct 18, 2018 10:04 am