Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Electron volts with boost::units?

Does boost::units have an option to express energy in electron volts (eV)? I can't seem to find the right header file for that

like image 466
T-Rex96 Avatar asked Mar 12 '26 11:03

T-Rex96


1 Answers

A bit late, but you can get it so:

boost::units::quantity<boost::units::si::energy> electronvolt 
   = 1. * boost::units::si::volt * boost::units::si::constants::codata::e;

(however, this is not what the user was asking: no, Boost.Units has no support for electronvolt)

like image 146
Michele Renda Avatar answered Mar 14 '26 23:03

Michele Renda