nicklockwood / Expression

A cross-platform Swift library for evaluating mathematical expressions at runtime
MIT License
829 stars 51 forks source link

Multiplication followed by dot followed by digit issue #11

Closed sebgiroux closed 6 years ago

sebgiroux commented 6 years ago

Hello,

I'm getting the following error: 13:18:25 ERROR Error in expression X/((16.7-W)*.0000212*Y*Z): Undefined infix operator *.

I was hoping this commit would fix the issue: https://github.com/nicklockwood/Expression/commit/08fef32a239261ea692aa47aba41f11ea765e1c9 but it doesn't seems like it does.

Probably a simpler expression like 1*.5 would fails as well.

Hopefully this can be fixed somewhat easily.

Thank you

nicklockwood commented 6 years ago

I suspect that the issue is that it sees . As a single operator. A space between the and . Should fix it.

I’ll see if I can come up with a way to disambiguate this in the next release.

nicklockwood commented 6 years ago

@sebgiroux fixed in 0.9.3

sebgiroux commented 6 years ago

@nicklockwood Indeed, it's all good now, thanks a lot!