fork download
  1. #include <cmath>
  2. #include <iostream>
  3.  
  4. int main()
  5. {
  6. const double h = 6.62606957e-34; // Planck constant
  7. const double c = 299792458.0; // speed of light in vacuum
  8. const double k = 1.3806488e-23; // Boltzmann constant
  9. const double wl = 380;
  10. const double T = 100;
  11.  
  12. double wavelength = wl * 1e-9;
  13.  
  14. double exparg = h*c / (k*wavelength*T);
  15. std::cout << "Exparg: " << exparg << std::endl;
  16. double exppart = std::exp(exparg) - 1.0;
  17. std::cout << "Exppart: " << exppart << std::endl;
  18. return 0;
  19. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
Exparg:  378.626
Exppart:  2.72253e+164