How to force a runtime constant to be a compile time constant?

前端 未结 4 772
执笔经年
执笔经年 2021-01-18 06:30

So I am working on a chemistry based project and ran into this tricky problem. I have a bunch of functions doing chemistry type calculations and want to pass avogadros numbe

4条回答
  •  悲&欢浪女
    2021-01-18 07:02

    Just define avogadros number as scientific notation:

    class Constants 
    {
        public double const avogadrosNum = 6.022e-22;
    } 
    

提交回复
热议问题