exp-mantissa part alone

x=4096; expx = large_exp(x) disp(expx);
how to get only the first part(mantissa part of the answer alone to find exponential and use it in program

 채택된 답변

Walter Roberson
Walter Roberson 2011년 9월 11일

0 개 추천

x=4096; expx = large_exp(x); mantissa = expx(1);

댓글 수: 6

x
x 2011년 9월 11일
si i used as u said above for various patch values...of thisexpx =
1.0e+006 *
0.0000 -2.6514
for this eg when i used to return only the mantissa part the answer must b 0 onlu na sir but i get 2.2722 and for most of my calculation i get 0.0000 only but returning some other values sir..what will b the problem
x
x 2011년 9월 11일
si i used as u said above for various patch values...of thisexpx =
1.0e+006 *
0.0000 -2.6514
for this eg when i used to return only the mantissa part the answer must b 0 onlu na sir but i get 2.2722 and for most of my calculation i get 0.0000 only but returning some other values sir..what will b the problem
x
x 2011년 9월 11일
again in my pgm i am in need of calculating exp(5.6458e+007) so when using the functn call which u mentioned yet i get
expx =
1.0e+007 *
0.0000 -2.4519 still zero but NAN get eliminated..and when finding mantissa alone i didn't get 0.000 instead i get 1.3375 ...y this occurs..?because of loop ah?and wt 2 do for that zero occurence
Walter Roberson
Walter Roberson 2011년 9월 11일
If you read the documentation for the "format" command, matters should become clearer.
x
x 2011년 9월 12일
sir where to use the format?why these mantissa values are different ?where to use format sir
Walter Roberson
Walter Roberson 2011년 9월 12일
As the first executable line of your program, put
format long g
After that, you will not get those silly 1.0e+007 * displays, and you will be able to see why the mantissa showed up as 1.3375 instead of 0.000 .

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

the cyclist
the cyclist 2011년 9월 11일

0 개 추천

I am not sure what you mean by large_exp(). I assume it is a function you wrote, or maybe it is in a toolbox that I do not have. Regardless, I expect that you can get at what you need by using the floor() function.

댓글 수: 2

x
x 2011년 9월 11일
inorder to calculate exp me used a function call and it gives expx =
1.0e+003 *
0.0074 1.7780 as my value for fimdimg exp(4096) the ans is the mantissa part alone ie)i want to get only 1.0e+003 *
0.0074 alone for this wt is to b done
x
x 2011년 9월 11일
function expx = large_exp(x)
t = x/log(10);
expx = [10^(t-floor(t)), floor(t)];
this s the fuction pgm

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

x
x
2011년 9월 11일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by