Announcements

Community notifications may experience intermittent interruptions between 10–12 November during scheduled maintenance. We appreciate your patience.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Engineering notation for floating point numbers

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.

4 Comments
JordanLJohnson
Autodesk

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).

sastanin
Collaborator

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.

mischa_spelt
Advisor

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?

Ben_WilsonADSK
Community Manager

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

  • Improved scientific notation for literals in FlexScript.

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea