Skip to content

Commit

Permalink
fix: #3155 remove an outdated section about complex numbers from the …
Browse files Browse the repository at this point in the history
…docs
  • Loading branch information
josdejong committed Feb 14, 2024
1 parent cee9deb commit 77d13c6
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions docs/expressions/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,19 +472,6 @@ parser.evaluate('i * i') // Number, -1
parser.evaluate('sqrt(-4)') // Complex, 2i
```

Math.js does not automatically convert complex numbers with an imaginary part
of zero to numbers. They can be converted to a number using the function
`number`.

```js
// convert a complex number to a number
const parser = math.parser()
parser.evaluate('a = 2 + 3i') // Complex, 2 + 3i
parser.evaluate('b = a - 3i') // Complex, 2 + 0i
parser.evaluate('number(b)') // Number, 2
parser.evaluate('number(a)') // Error: unexpected type of argument
```


### Units

Expand Down

0 comments on commit 77d13c6

Please sign in to comment.