Skip to content

Squared units causing TypeError with BigNumber configured #1304

@zcohan

Description

@zcohan

I'm encountering an error when evaluating units with a power sign (squared units) with BigNumber on.

Example:

const math = require('./math.min.js')
math.config({number: 'BigNumber', precision: 64}) //disable big number and the following expression works fine, but with big number on, it fails
math.eval('9.7 meters^2')

The error is:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions