View previous topic :: View next topic |
Author |
Message |
uga237
Joined: 15 May 2012 Posts: 32
|
Posted: Tue Aug 12, 2014 2:20 am Post subject: double < 0 |
|
|
Dim test as double
test = 12345
IF test < 0 then 'some time fail
.
.
.
IF test < 0.0 then 'work good
.
.
.
why?
(BASCOM-AVR version : 2.0.7.7 ) |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Tue Aug 12, 2014 9:05 am Post subject: |
|
|
0 and 0.0 are the same and will give the same result. if you compile 2 different samples and compare the output you will find they are (binary) identical.
so please produce a sample that demonstrates this problem.
Or send a sample/code to support. _________________ Mark |
|
Back to top |
|
|
six1
Joined: 27 Feb 2009 Posts: 553
|
|
Back to top |
|
|
uga237
Joined: 15 May 2012 Posts: 32
|
|
Back to top |
|
|
six1
Joined: 27 Feb 2009 Posts: 553
|
Posted: Thu Aug 14, 2014 10:32 am Post subject: |
|
|
Hi,
in my mind, you didn't understand, that in binary system you can not show all possible floatingpoint numbers.
Read the help and think about.
regards, michael _________________ For technical reasons, the signature is on the back of this message. |
|
Back to top |
|
|
uga237
Joined: 15 May 2012 Posts: 32
|
Posted: Thu Aug 14, 2014 2:13 pm Post subject: |
|
|
Michael.
You don't understand my question about compare Double and Zero.
Think about.
Ivan. |
|
Back to top |
|
|
six1
Joined: 27 Feb 2009 Posts: 553
|
Posted: Thu Aug 14, 2014 4:22 pm Post subject: |
|
|
ahh, ok... that can be the solution...
i do not understand and therefore your code doesn't work...
You ask about precision and have doubt about my skill?
Maybe you better start debug and have a look for what exactliy going on in your micro...
best, michael _________________ For technical reasons, the signature is on the back of this message. |
|
Back to top |
|
|
uga237
Joined: 15 May 2012 Posts: 32
|
Posted: Fri Aug 15, 2014 3:44 am Post subject: |
|
|
You ask about precision and have doubt about my skill? - no
Some time positive double value lower then Zero.
Why precision?
my code is very big size. i try simulate this on small code and post here.
And sorri my english ) I am from Russia.
P. S. ..and have doubt about my skill?.. - i smile ))) |
|
Back to top |
|
|
|