From 37d57f3cb63458374a743e442e35ace485d97a37 Mon Sep 17 00:00:00 2001 From: Zhao Liang Date: Mon, 16 Jan 2023 14:10:27 +0800 Subject: [PATCH] [Doc] Update math_module.md (#7175) This PR adds comments to complex arithmetics examples. --- docs/lang/articles/math/math_module.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/lang/articles/math/math_module.md b/docs/lang/articles/math/math_module.md index bb791d0333162..5d3a1eb43a3fc 100644 --- a/docs/lang/articles/math/math_module.md +++ b/docs/lang/articles/math/math_module.md @@ -176,8 +176,9 @@ You can also compute the power, logarithm, and exponential of a complex number: @ti.kernel def test(): - x = tm.vec2(1, 1) - y = tm.cpow(x, 2) - z = tm.clog(x) - w = tm.cexp(x) + x = tm.vec2(1, 1) # complex number 1 + 1j + y = tm.cpow(x, 2) # complex number (1 + 1j)**2 = 2j + z = tm.clog(x) # complex number (0.346574 + 0.785398j) + w = tm.cexp(x) # complex number (1.468694 + 2.287355j) + ```