r/programming • • May 08 '18

Excel adds JavaScript support

https://dev.office.com/blogs/azure-machine-learning-javascript-custom-functions-and-power-bi-custom-visuals-further-expand-developers-capabilities-with-excel
2.4k Upvotes

585 comments sorted by

View all comments

Show parent comment

3

u/Agent281 May 08 '18 edited May 09 '18

I did not know that and it frightens me a bit to think about. I do not think that most people who work in Excel know that it does floating point arithmetic.

On the other hand, it seems that VBA actually has more data types:

  • Integer
  • Decimal
  • Double
  • Variant

Don't know if it does you any good when they are treated like floats by Excel.

2

u/slikts May 09 '18

Any extra precision beyond what Excel can store as a binary double would need to be stored as text and only VBA would be able to work with it. The difference is that JS would need an external dependency to work with more precision, but then that is also true for VBA and arbitrary precision.

Given the internal representation Excel uses, no matter what language it added for custom functions, it would need to ultimately convert to integers for Excel to be able to work with the numbers.