Warum 1,0/100.0 == 0.1/10.0 gilt?

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Warum 1,0/100.0 == 0.1/10.0 gilt?

by Anonymous » 17 Feb 2025, 08:36

Ich habe gelernt, dass 0,1 + 0,2! = 0,3 aufgrund der 0,1 und 0,2 nicht genau 0,1 und 0,2 sind. "Richtig"? < /P>
float1 = 1.0/100.0
float2 = 0.1/10.0
print( float1 == float2 )
< /code>
gilt auch für c: < /p>
double slope1 = 1.0 / 100.0;
double slope2 = 0.1 / 10.0;

int main(int argc, const char * argv[]) {
printf( "%d", slope1 == slope2 );
}
< /code>
Was habe ich vermisst oder falsch verstanden? Bitte lehren Sie.

Top