acts-project / detray

Test library for detector surface intersection
Mozilla Public License 2.0
10 stars 18 forks source link

Removing the scalar type template in units and constants #789

Closed beomki-yeo closed 3 months ago

beomki-yeo commented 3 months ago

I think defining them with the float type will be OK because the conversion from float-to-double is not a problem?

niermann999 commented 3 months ago

Should we not make sure that the floating point error is fine in traccc, before we introduce more cutoff errors? Edit: Ah no, wait, that will only change anything in double precision, nvm

beomki-yeo commented 3 months ago

float-to-double can also introduce cutoff errors? If so, it would be better not to touch it

niermann999 commented 3 months ago

Ah, maybe I did not understand what you mean. I thought you proposed to put the constants/units into single precision by default. These would then be less precise than double precision even before the float-to-double conversion instruction happens, I guess.

niermann999 commented 3 months ago

Maybe we can do things a bit more elegantly with c++20 and user defined literals / std math constants though

beomki-yeo commented 3 months ago

OK let's see.. I also don't know if it is even a good idea :/