...

View Full Version : VbScript to Javascript Math Problem



Engisoft
08-12-2005, 12:49 AM
Can anyone tell me why when I convert this vbscript code to javascript I get infinity rather than 0.876794146362291?

VbScript:
GetBase = (1 - (1 + 0.00583333333333333) ^ -360)
Results to 0.876794146362291

Javascript:
Math.pow(1 - (1 + 0.00583333333333333), -360);
Results to Infinity

BaldEagle
08-12-2005, 07:37 AM
If you want them to be equivalent rewrite it like this:

1 - Math.pow(1 + 0.00583333333333333, -360);

BaldEagle

Engisoft
08-21-2005, 05:08 PM
Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum