Skip to content

Can't compare string with anything #1051

@hyzhak

Description

@hyzhak

version

Strings comparison doesn't work for strings:

math.eval('"abc" == "abc"');
// or
math.equal('abc', 'abc');
// and 
math.equal(1, 'abc');

return error:

Error: Cannot convert "abc" to a number
    at convert (/node_modules/mathjs/lib/core/typed.js:195:17)
    at Array.convertArg (/node_modules/typed-function/typed-function.js:819:22)
    at convertArgs (/node_modules/typed-function/typed-function.js:766:45)
    at generic (/node_modules/typed-function/typed-function.js:1073:27)
    at equalScalar (/node_modules/typed-function/typed-function.js:1092:24)
    at any, any (/node_modules/mathjs/lib/function/relational/equal.js:69:14)
    at generic (/node_modules/typed-function/typed-function.js:1073:27)
    at Object.equal (/node_modules/typed-function/typed-function.js:1092:24)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions