X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=doc%2Ftutorial%2Fginac.texi;h=a47e7cadaf39c0e813708a316500cd43d5e9ce30;hp=d4ab7fb571e2945452becd996c6b18ed5734b4db;hb=967f91512ca4415df4950ae9cc5cd5d524e6edca;hpb=83c1a0ba18b918a02fea05272d6e9e514880b707 diff --git a/doc/tutorial/ginac.texi b/doc/tutorial/ginac.texi index d4ab7fb5..a47e7cad 100644 --- a/doc/tutorial/ginac.texi +++ b/doc/tutorial/ginac.texi @@ -280,8 +280,23 @@ integers: 1/3 @end example -All numbers occuring in GiNaC's expressions can be converted into floating -point numbers with the @code{evalf} method, to arbitrary accuracy: +Exact numbers are always retained as exact numbers and only evaluated as +floating point numbers if requested. For instance, with numeric +radicals is dealt pretty much as with symbols. Products of sums of them +can be expanded: + +@example +> expand((1+a^(1/5)-a^(2/5))^3); +1+3*a+3*a^(1/5)-5*a^(3/5)-a^(6/5) +> expand((1+3^(1/5)-3^(2/5))^3); +10-5*3^(3/5) +> evalf((1+3^(1/5)-3^(2/5))^3); +0.33408977534118624238 +@end example + +The function @code{evalf} that was used above converts any number in +GiNaC's expressions into floating point numbers. This can be done to +arbitrary predefined accuracy: @example > evalf(1/7);