ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 29 Jan 2019 01:15:51 +0100can i display only two decimals of precisionhttps://ask.sagemath.org/question/45222/can-i-display-only-two-decimals-of-precision/I have some lists I want to display. I don't want to limit the precision for the arithmetic that created them, I only want to limit the number of decimal places (not significant figures) that are displayed.
def f(n): return sorted([ 2*cos(2*3.14159*j/n) for j in range(n) ]) ;
f(5)
Gives me the five required values displayed with what seems to be 14 digits after the decimal.
Is it possible to change 14 to some other value?mike newmanTue, 29 Jan 2019 01:15:51 +0100https://ask.sagemath.org/question/45222/Memory error mixing exact numbers and decimal oneshttps://ask.sagemath.org/question/36618/memory-error-mixing-exact-numbers-and-decimal-ones/ Hi,
I wonder why this code gives an error in Sage 7.5.1:
f(x)=3*sin(2*pi*(1.75-2*x))
if abs(f(0.7)) < 1e-12:
print 1
MemoryError: Not enough memory to calculate cyclotomic polynomial of 428914250225777franpenaTue, 14 Feb 2017 18:42:39 +0100https://ask.sagemath.org/question/36618/Problem with my for-loophttps://ask.sagemath.org/question/34280/problem-with-my-for-loop/
Does someone know how to get answer to this ?
list = [x for x in range (100) if (x + 0.75) == 20]
I was experimenting with Sage when computer says that there isn´t possible answer [] to this elementary maths problem .
There is any problem with using decimals number in a list?
I also try doing this : but it still doesn´t working
list = [float(x) for x in range (100) if (x + 0.75) == 20]
Thank you so much , Excuse my bad English! :))ImproveMESun, 31 Jul 2016 15:48:47 +0200https://ask.sagemath.org/question/34280/polynomial digits of pihttps://ask.sagemath.org/question/9892/polynomial-digits-of-pi/How to find polynomial p_N(n) coefficients a_i_N,
p_N(n) = sum_i ( a_i_N * n^i , i=0:N )
such that p_N(n) gives the decimals of pi (where n=0...N) up to N:th decimal place. I did not find this in Sage ready made.
Does Sage have a function or another way to do this (returning a_i_N for each p_N, N ={1,2,...})? It should be both a numerical value up to a certain precision and a symbolic accurate answer?
JPIThu, 07 Mar 2013 12:28:18 +0100https://ask.sagemath.org/question/9892/