# Wrong values with greater than, equal and less than or equal functions

9 views (last 30 days)
Irene on 17 May 2011
[EDIT: Tue May 17 14:40:06 UTC 2011 - Reformat - MKF]
When I use the greater than function, equal function and less than or equal function I obtain wrong values, for example:
>> 1.6-1.5>.1
ans =
1
>> (1.6-1.5)>.1
ans =
1
>> (1.6-1.5)>0.1
ans =
1
>> eq((1.6-1.5),0.1)
ans =
0
>> gt((1.6-1.5),0.1)
ans =
1
>> le((1.6-1.5),0.1)
ans =
0
##### 0 CommentsShow -2 older commentsHide -2 older comments

Sign in to comment.

### Accepted Answer

Andy on 17 May 2011
##### 0 CommentsShow -2 older commentsHide -2 older comments

Sign in to comment.

### More Answers (1)

James Tursa on 17 May 2011
You might find this utility useful:
It will display the exact decimal value of the numbers you are working with.
##### 0 CommentsShow -2 older commentsHide -2 older comments

Sign in to comment.

### Categories

Find more on Timing and presenting 2D and 3D stimuli in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!