Math::Floor problem ...

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello,
I have small problem with Math::Floor function. Is this really correct ?

<div style="font-family:Courier New; font-size:10pt; color:black; background:white
<p style="margin:0px <span style="color:#2b91af 11506 <span style="color:blue for (
<span style="color:blue double i=0; i<3; i=i+0.1){
<p style="margin:0px <span style="color:#2b91af 11507 Console::WriteLine(<span style="color:#a31515 "{0} {1} ", i , Math::Floor( i ) ) ;
<p style="margin:0px <span style="color:#2b91af 11508 }<span style="color:green //
<p style="margin:0px <span style="color:#2b91af 11509
<p style="margin:0px <span style="color:#2b91af 11510 <span style="color:blue double R1 = 1;
<p style="margin:0px <span style="color:#2b91af 11511 Console::WriteLine(<span style="color:#a31515 "{0} {1}", 1 , Math::Floor(R1) );
<p style="margin:0px <span style="color:#2b91af 11512
<p style="margin:0px <span style="color:#2b91af 11513 0 0
<p style="margin:0px <span style="color:#2b91af 11514 0,1 0
<p style="margin:0px <span style="color:#2b91af 11515 0,2 0
<p style="margin:0px <span style="color:#2b91af 11516 0,3 0
<p style="margin:0px <span style="color:#2b91af 11517 0,4 0
<p style="margin:0px <span style="color:#2b91af 11518 0,5 0
<p style="margin:0px <span style="color:#2b91af 11519 0,6 0
<p style="margin:0px <span style="color:#2b91af 11520 0,7 0
<p style="margin:0px <span style="color:#2b91af 11521 0,8 0
<p style="margin:0px <span style="color:#2b91af 11522 0,9 0
<p style="margin:0px <span style="color:#2b91af 11523 1 0
<p style="margin:0px <span style="color:#2b91af 11524 1,1 1
<p style="margin:0px <span style="color:#2b91af 11525 1,2 1
<p style="margin:0px <span style="color:#2b91af 11526 1,3 1
<p style="margin:0px <span style="color:#2b91af 11527 1,4 1
<p style="margin:0px <span style="color:#2b91af 11528 1,5 1
<p style="margin:0px <span style="color:#2b91af 11529 1,6 1
<p style="margin:0px <span style="color:#2b91af 11530 1,7 1
<p style="margin:0px <span style="color:#2b91af 11531 1,8 1
<p style="margin:0px <span style="color:#2b91af 11532 1,9 1
<p style="margin:0px <span style="color:#2b91af 11533 2 2
<p style="margin:0px <span style="color:#2b91af 11534 2,1 2
<p style="margin:0px <span style="color:#2b91af 11535 2,2 2
<p style="margin:0px <span style="color:#2b91af 11536 2,3 2
<p style="margin:0px <span style="color:#2b91af 11537 2,4 2
<p style="margin:0px <span style="color:#2b91af 11538 2,5 2
<p style="margin:0px <span style="color:#2b91af 11539 2,6 2
<p style="margin:0px <span style="color:#2b91af 11540 2,7 2
<p style="margin:0px <span style="color:#2b91af 11541 2,8 2
<p style="margin:0px <span style="color:#2b91af 11542 2,9 2
<p style="margin:0px
<p style="margin:0px <span style="color:#2b91af 11543 1 1

Line 11523 is problem. I would expect, that Math::Floor(i) == 1 if i == 1.

Thanks.


<br/>
<br/>

View the full article
 

Similar threads

K
Replies
0
Views
220
Khan345
K
D
Replies
0
Views
97
Donald Uko
D
I
Replies
0
Views
146
Innovators World Wide
I
Back
Top