how to convert a number in exponential form to normal decimal form?
조회 수: 26(최근 30일)
I am trying to get the complete value of the number which is in exponential form but its not showing the complete value. I have tried below:
Output : 4451685225093714900000000000000000
but the correct output should be 4451685225093714772084598273548427
Is there any other method to get the complete value?
Stephen23 2018년 6월 6일
편집: Stephen23 2018년 6월 6일
That value is far too large to store in a double without loss of precision. You will need to use a custom data class, a symbolic variable, or store the output digits in a char vector. If you are okay with having the output digits in a char vector then you can download John D'Errico's excellent base2base function:
ans = 4451685225093714772084598273548427
You could easily convert the output of base2base to a symbolic variable.