The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: about float value
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
LEI Zhang

Posts: 10
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

it will never enter into the condition section.

Every time, I have to do this:

if round(AAA*1000)/1000 == 0.004

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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.