Missing Math functions
# David-Sarah Hopwood (17 years ago)
Alistair Braidwood wrote:
I wondered if a future ECMAScript could expand its Math API to include functions such as log10, log2, and hypot? I realize that these are calculable, but they occur often enough to be useful.
Added as a proposal for ES-Harmony at bugs.ecmascript.org/ticket/460.
The Math functions in ECMAScript are very much like the ones in Java 1 (deliberately so).
For some reason (reduced API size?) Sun decided to drop some standard C functions when they developed Java. They have since reinstated some of them (since Java1.5) In the current draft, section 15.8.2 says:
I wondered if a future ECMAScript could expand its Math API to include functions such as log10, log2, and hypot? I realize that these are calculable, but they occur often enough to be useful.
I'm not so sure about the browser-side uses of hyperbolic trig, but if it's easy to add, then why not - they are part of the standard pre-C99 math.h.
Alistair
ps. this is not saying that ECMAScript should follow Java, more that as an independent language it can expand its math capabilities beyond the Java1 limit imposed at its creation.