Skip to content

Commit 8626508

Browse files
committed
docs: simplify giac_commands examples using direct variable syntax
1 parent 8e67603 commit 8626508

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

docs/src/api/giac_commands.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ Access commands via `Giac.Commands.commandname`:
4949
using Giac
5050

5151
@giac_var x
52-
expr = giac_eval("x^2 - 1")
52+
expr = x^2 - 1
5353

5454
# Access commands via Giac.Commands
5555
Giac.Commands.factor(expr) # (x-1)*(x+1)
56-
Giac.Commands.expand(giac_eval("(x+1)^2")) # x^2+2*x+1
56+
Giac.Commands.expand((x+1)^2) # x^2+2*x+1
5757
Giac.Commands.diff(expr, x) # 2*x
5858
Giac.Commands.integrate(expr, x) # x^3/3-x
59-
Giac.Commands.ifactor(giac_eval("120")) # 2^3*3*5
59+
Giac.Commands.ifactor(120) # 2^3*3*5
6060
```
6161

6262
### 2. Selective Import
@@ -68,11 +68,11 @@ using Giac
6868
using Giac.Commands: factor, expand, diff, integrate
6969

7070
@giac_var x
71-
expr = giac_eval("x^2 - 1")
71+
expr = x^2 - 1
7272

7373
# Direct function syntax (no prefix needed)
7474
factor(expr) # (x-1)*(x+1)
75-
expand(giac_eval("(x+1)^2")) # x^2+2*x+1
75+
expand((x+1)^2) # x^2+2*x+1
7676
diff(expr, x) # 2*x
7777
integrate(expr, x) # x^3/3-x
7878
```
@@ -86,10 +86,10 @@ using Giac
8686
using Giac.Commands # Imports ALL exportable commands
8787

8888
@giac_var x
89-
factor(giac_eval("x^2 - 1")) # (x-1)*(x+1)
90-
ifactor(giac_eval("120")) # 2^3*3*5
91-
nextprime(giac_eval("100")) # 101
92-
airy_ai(giac_eval("0")) # Airy function
89+
factor(x^2 - 1) # (x-1)*(x+1)
90+
ifactor(120) # 2^3*3*5
91+
nextprime(100) # 101
92+
airy_ai(0) # Airy function
9393

9494
# Discover available commands
9595
exportable_commands() # ~2000+ command names
@@ -131,7 +131,7 @@ integrate(x^2, x) # x^3/3
131131
integrate(x^2, x, 0, 1) # returns
132132
//~= 0.333333333333
133133
GiacExpr: 1/3
134-
limit(sin(x)/x, x, giac_eval("0")) # 1
134+
limit(sin(x)/x, x, 0) # 1
135135
simplify(a + b - a) # b
136136
solve(x^2 - 1)
137137
solve(x^2 - 1, x) # list[-1,1]

0 commit comments

Comments
 (0)