# How to write so the script can recognize an imaginary number?

## Recommended Posts

How do I write a script that can recognize imaginary numbers like (-4)^(1/2) and like maybe even write the number as 2i?

##### Share on other sites

How do I write a script that can recognize imaginary numbers like (-4)^(1/2) and like maybe even write the number as 2i?

Think of a plan.

Open SciTe

Start Typing

Hit a problem

Post to the forum

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

##### Share on other sites

The script at

http://www.autoitscript.com/forum/index.ph...st&p=607270

can return a complex number (real and imaginary part) for an example.

##### Share on other sites

Hi I've been trying to get my script to recognize imaginary numbers for the past two hours. I don't know how to start, can anyone show me what's one way to teach the script to recognize imaginary numbers?

##### Share on other sites

Hi I've been trying to get my script to recognize imaginary numbers for the past two hours. I don't know how to start, can anyone show me what's one way to teach the script to recognize imaginary numbers?

```; How to write so the script can recognize an imaginary number?

Local \$aNum[5] = [3, "3i", 2]

For \$x = 0 To 2
If StringInStr(\$aNum[\$x], "i") Then MsgBox(0, "", \$aNum[\$x] & @CRLF & "Look! There's one")
Next```

##### Share on other sites

<2 posts merged>

Do not create multiple topics on the same subject matter, or you'll lose posting privileges all together.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

## Create an account

Register a new account