josdejong/mathjs

[Document the] secant function messing up sec unit

Open

#2,095 建立於 2021年1月28日

在 GitHub 查看
 (4 留言) (0 反應) (0 負責人)JavaScript (1,298 fork)batch import
documentationhelp wanted

倉庫指標

Star
 (13,832 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

I believe "sec" is a built-in alias for the time unit seconds. However, if I type "5 sec" into the https://mathnotepad.com (or the evaluate input on https://mathjs.org) the function sec seems to take precedence and throw a TypeError even though it is expecting a unit:

TypeError: Unexpected type of argument in function multiplyScalar (expected: number or Unit or string or boolean or BigNumber or Complex or Fraction, actual: function, index: 1)

Can we improve the parser to avoid this confusion? It seems the unit "sec" is currently unavailable.

貢獻者指南