java - BigDecimal constructor performance - string vs numeric -


new bigdecimal("10000"); new bigdecimal(10000); 

i know string constructor used if number bigger compiler accept, either of constructors faster other?

you can @ source code.

public bigdecimal(int val) {     intcompact = val; }  public bigdecimal(string val) {     this(val.tochararray(), 0, val.length()); }  public bigdecimal(char[] in, int offset, int len) {        ...very long } 

obviously, faster.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -