Home > Back-end >  A computational problems in C code, who can help?
A computational problems in C code, who can help?

Time:11-18

Is a simple subtraction, code and operation result are in the picture, why la - & gt; Unlike myf aclike cost? Really don't understand the

CodePudding user response:

By myself, who help me, thank you

CodePudding user response:

Who help bumps, and by and by

CodePudding user response:

After another wall bumps bumps bumps bumps

CodePudding user response:

More than a few variables, print out a few times more, the problem is more obvious, is not the same as is reasonable, because the float have 6-7 a valid number, so 2971.956 should be accurate, at the back of the random

CodePudding user response:

Suggested all code directly ~

CodePudding user response:

reference 5 building self-confidence boy reply:
suggested all code directly ~

I use this app # CSDN# found have technical content of the blog and friends to seek common to "this super simple code, the output is correct", gathered together at https://bbs.csdn.net/topics/397584709

CodePudding user response:

reference 4 floor poetryTang response:
define several variables, print a few times more, the problem is more obvious, is not the same as is reasonable, because the float have 6-7 a valid number, so 2971.956 should be accurate, the back of the random

I use this app # CSDN# found have technical content of the blog and friends to seek common to "this super simple code, the output is correct", gathered together at https://bbs.csdn.net/topics/397584709

CodePudding user response:

Type should not float, otherwise it must be equal to
Post definitions show

CodePudding user response:

refer to the eighth floor nice_cxf response:
type should not float, otherwise it must be equal to
Stick to define see

Really is a float

CodePudding user response:

refer to the eighth floor nice_cxf response:
type should not float, otherwise it must be equal to
Stick to define see

I also tried it on, the same variable output two consecutive times, the result is different

CodePudding user response:

 la - & gt; Aclike=PTH - & gt; Kike - PRLK; 

Immediately after the output la - & gt; Aclike try?

CodePudding user response:

With what the compiler? Supposedly not possible, the same data are floating point, use % f two display must be the same

CodePudding user response:

The
reference 11 floor MianHou response:
 la - & gt; Aclike=PTH - & gt; Kike - PRLK; 

Immediately after the output la - & gt; Aclike try?

Output is immediately

CodePudding user response:

I am using nmake way, I look at the code it is estimated that there are twenty years or so

CodePudding user response:

Use type double

CodePudding user response:

With double line, float from high to low effective, up to seven behind is random, you can use a 10000.0/3.0 to try to know
  • Related