nehel - 1 year ago 102

jQuery Question

I'm trying to get like first 7-8 numbers after digit on a number that is

`Infinity`

I.E.

`console.log((4^3)/(3^3));`

`Infinity`

`2.370370370...`

`2.370370370e+-60`

I tried to make it with

`result.toExponential(8);`

Recommended for you: Get network issues from **WhatsUp Gold**. **Not end users.**

Answer Source

In javascript, exponentiation is made by the `Math.pow`

function. There is no inline operator like `^`

(as in python with `**`

).

You should instead compute

```
Math.pow(4, 3) / Math.pow(3, 3)
```

A part from that,

you were computing `(4 XOR 3) / (3 XOR 3)`

, which evaluates to 7 / 0, which is an Infinity.

Recommended from our users: **Dynamic Network Monitoring from WhatsUp Gold from IPSwitch**. ** Free Download**