Idea

Serge A avatar image
6 Likes"
Serge A suggested Ben Wilson commented

Engineering notation for floating point numbers

Eventually simulation is about numbers. It would be nice if Flexsim supported engineering notation (E-notation) for floating point numbers, like

1.25e9 instead of 1250000000 (BTW, did I type the correct number of zeros?)

1e-8 instead of 0.00000001 (did I type the correct number of zeros?)

This notation is available in most programming languages, is built-in in Excel and even in the default Windows calculator app. I would be hard pressed to find a moderately advanced calculation tool which doesn't support it.

This feature would greatly improve usability of the simulator environment for users who are already familiar with this E-notation (and I suppose there is a lot of overlap between Flexsim users, engineers and Excel power users). It would also be beneficial by eliminating a source of subtle modeling errors.

And if Flexscript floating point parser is overhauled, I'd like you to consider also another enhancement: an optional digit separator for long numbers, similar to underscore in Julia floating point numbers. For reference, in Julia 1_234_567.89 is equivalent to 1234567.89 and 1.23456789e6, but is easier to read.

flexscriptfeature requestfloating point
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jordan Johnson avatar image Jordan Johnson ♦♦ commented ·

In version 17.0, floating point literals (1.25, for example) can optionally have an exponent. 1.25e9 is correctly parsed by FlexScript now. I will add an issue to the dev list for adding support for integer exponents (1e-8 does not currently work; 1.0e-8 does).

5 Likes 5 ·
Serge A avatar image Serge A Jordan Johnson ♦♦ commented ·

Thank you. I did quickly test parsing in version 17.0, but didn't discover that it is sort of supported already. Good to know.

1 Like 1 ·
Mischa Spelt avatar image Mischa Spelt Jordan Johnson ♦♦ commented ·

Cool, thanks @jordan.johnson, did not know that this could already be used with floats. Would be cool if you can extend it to integers. Also noticed that 1.e9 (or 1. for that matter) breaks - if there is a dot you expect at least one decimal?

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ commented ·

FlexSim 2017 Update 1 (just released in beta [2017-03-08]) adds the following feature:

  • Improved scientific notation for literals in FlexScript.
0 Likes 0 ·

No Comments

·

Write a Comment

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.