I'm not particularly knowledgeable about programming, and I'm trying to figure out how to get the exact value calculated in a C program. I need a constant negative power of 7, with 5 significant digits. Any suggestions (bearing in mind that I know very little, have never been programmed in anything other than with and only during the necessary courses that I took several years ago at school)?
Thank!
, 5 , float double. double.
float
double
7 th 1 7 th ...
double k = 1.2345678; // your constant, whatever it is double ktominus7 = 1.0 / (k * k * k * k * k * k * k);
... !
, -
printf("My number is: %9.5g\n", ktominus7);
. , [ /MATLAB/other ], C.
. 32- IEEE-754, float C, 24 , 7,2 . , . double 53 ( 16 ). Carl Smotricz , pow C, -7.0 .
pow
-7.0
, , , , .
long double , . . . . , (1) , 15 . IEEE 754 (.. Binary128), , long double:)
long double
, ?
you can use the journal to convert small numbers to large numbers and do your math in the version converted to a journal. it's pretty complicated, but it will work most of the time. you can also switch to python which does not have this problem.
Source: https://habr.com/ru/post/1737235/More articles:How to get the top 3 frequencies in MySQL? - sqlhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1737231/how-to-get-this-to-compile&usg=ALkJrhjMcyxnR3rMaRJsaKHpBsObDphV8gGet 2 last posts for each category - optimizationJoining iPhone CoreData - sqliteJava Process Problem in Eclipse - eclipseUsing IOC in a remote scenario - .netHow to override "inherited" z-indexes? - inheritanceAre there debugging symbols for Sharepoint? - debuggingWebmessenger, IM, chat clients - Jabber? (e.g. Facebook) - facebookPosition element under another - htmlAll Articles