Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Why does node does not return Infinity for Math.tan(Math.PI/2) but Chrome does? #7852

Closed
ludydoo opened this issue Jun 27, 2014 · 1 comment

Comments

@ludydoo
Copy link

ludydoo commented Jun 27, 2014

When running this in a node command-line interface:

> Math.tan(Math.PI/2)
16331778728383844 

But in Chrome:

> Math.tan(Math.PI/2)
Infinity

Aren't both using the same V8 engine?

Node's result is not even equal to the maximum "integer" value in JavaScript.

(http://stackoverflow.com/questions/24455775/why-does-node-not-evaluate-math-tanmath-pi-2-to-infinity-but-chrome-v8-does)

@indutny
Copy link
Member

indutny commented Jun 27, 2014

I guess you are using node.js v0.10 or older version. Unfortunately, we can't update v8 in stable branches. Try using v0.11 (the github master or some v0.11.x git tag), it works just fine there.

@indutny indutny closed this as completed Jun 27, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants