Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: about float value
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
LEI Zhang

Posts: 8
Registered: 8/30/11
about float value
Posted: Jan 11, 2013 12:39 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi, I have a problem which is bothering me all the time.

I have a float value, say AAA, which is equal to 0.004

now in a very simple judgement function:

if AAA == 0.004
disp('ok')
end

it will never enter into the condition section.

Every time, I have to do this:

if round(AAA*1000)/1000 == 0.004
disp('ok')
end

That makes it work.

I think this should be a common question, but I don't know how to search it.
Sorry if I post it again.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.