Conversion operator -

Aug 29, 2014 at 5:53 AM
Dear Oystein,

I realize you are in the process of moving also this project to Github, but since I cannot find any discussion page there yet, I hope it is OK that I post my question here.

I notice in the examples you show on the front page that you are using the minus operator (-) to convert a double to a specific quantity, e.g.
Length s = 100 - Length.Metre;
What is your rationale for using the minus operator? Intuitively, I would consider the multiplication operator a more "correct" choice. Or, do you disagree?

If you for example construct an Area object, it could look like this (not sure if this works in QuantityTypes right now, but I hope you see my point):
Area a = 100 * Length.Metre * Length.Metre;
Right out of the box, I can think of one library where they are using the multiplication operator for this purpose, namely the GEANT High Energy Particles Monte Carlo code, see here.

Just my two cents :-) Looking forward to hearing what you think.

Best regards,
Anders @ Cureos
Coordinator
Aug 29, 2014 at 7:11 AM
Edited Aug 29, 2014 at 7:12 AM
Thanks for the notice! I have fixed the error now. (I had done a search/replace for "* " to "- " for the lists....)

Thanks for the link to GEANT!
Marked as answer by cureos on 8/29/2014 at 12:19 AM