NikhilS / vb2js

Automatically exported from code.google.com/p/vb2js
2 stars 3 forks source link

Exponent operator (' ^ ') is not converted into equivalent Js function Math.pow() #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Enter the following VB script code to convert

  c = 2 ^ 2
  c = 10.01 ^ 2
  c = 10.9 ^ 1.1
  c = 10 ^ a
  c = a ^ 10
  c = a ^ b

3. Actual JS :  operator '^' is being converted into exp() but there is no 
function 'exp' in Javascript
  c = exp(2, 2);
  c = exp(10.01, 2);
  c = exp(10.9, 1.1);
  c = exp(10, a);
  c = exp(a, 10);
  c = exp(a, b);

  Expected.JS:
  c = Math.pow(2, 2);
  c = Math.pow(10.01, 2);
  c = Math.pow(10.9, 1.1);
  c = Math.pow(10, a);
  c = Math.pow(a, 10);
  c = Math.pow(a, b);

Original issue reported on code.google.com by nikhilsi...@google.com on 16 May 2010 at 6:02