number instead of expression

9 views
Skip to first unread message

68th

unread,
Sep 27, 2023, 10:53:27 AM9/27/23
to '68th' via FriCAS - computer algebra system
Hello,

sum2 := sum(cos(%pi*i/n), i = 1..n)
eval(sum2, n=10)

gives me an expression. How do I get a real number instead?

Waldek Hebisch

unread,
Sep 27, 2023, 11:08:06 AM9/27/23
to '68th' via FriCAS - computer algebra system
After the to lines above use:

numeric(%)

--
Waldek Hebisch

68th

unread,
Sep 28, 2023, 10:55:30 AM9/28/23
to fricas...@googlegroups.com
> numeric(%)

Thank you.
Reply all
Reply to author
Forward
0 new messages