Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

difference between %e/E, %f/F and %g/G in program C

void main(int argc, char* argv[])  
{  
        double a = 4.5;
        printf("=>>>> below is the example for printf 4.5
");
        printf("%%e %e
",a);
        printf("%%f %f
",a);
        printf("%%g %g
",a);
        printf("%%E %E
",a);
        printf("%%F %F
",a);
        printf("%%G %G
",a);
          
        double b = 1.79e308;
        printf("=>>>> below is the exbmple for printf 1.79*10^308
");
        printf("%%e %e
",b);
        printf("%%f %f
",b);
        printf("%%g %g
",b);
        printf("%%E %E
",b);
        printf("%%F %F
",b);
        printf("%%G %G
",b);

        double d = 2.25074e-308;
        printf("=>>>> below is the example for printf 2.25074*10^-308
");
        printf("%%e %e
",d);
        printf("%%f %f
",d);
        printf("%%g %g
",d);
        printf("%%E %E
",d);
        printf("%%F %F
",d);
        printf("%%G %G
",d);
}
Comment

difference between %e/E, %f/F and %g/G in program C

=>>>> below is the example for printf 4.5
%e 4.500000e+00
%f 4.500000
%g 4.5
%E 4.500000E+00
%F 4.500000
%G 4.5
=>>>> below is the exbmple for printf 1.79*10^308
%e 1.790000e+308
%f 178999999999999996376899522972626047077637637819240219954027593177370961667659291027329061638406108931437333529420935752785895444161234074984843178962619172326295244262722141766382622299223626438470088150218987997954747866198184686628013966119769261150988554952970462018533787926725176560021258785656871583744.000000
%g 1.79e+308
%E 1.790000E+308
%F 178999999999999996376899522972626047077637637819240219954027593177370961667659291027329061638406108931437333529420935752785895444161234074984843178962619172326295244262722141766382622299223626438470088150218987997954747866198184686628013966119769261150988554952970462018533787926725176560021258785656871583744.000000
%G 1.79E+308
=>>>> below is the example for printf 2.25074*10^-308
%e 2.250740e-308
%f 0.000000
%g 2.25074e-308
%E 2.250740E-308
%F 0.000000
%G 2.25074E-308
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to make game restart when player touches a object unity 
Csharp :: unity generate random offset position around a gameobject 
Csharp :: c# i++ meaning 
Csharp :: Adding number of day remaining to future date from now 
Csharp :: how to make character respawn if touches sprite c# 
Csharp :: MVC Razor check for postback 
Csharp :: push vaiable in array c# 
Csharp :: entity framework core search keyword query example 
Csharp :: c# void with nullable List argument 
Csharp :: parallelism in c# 
Csharp :: cmd.executenonquery() error in c# 
Csharp :: unity prefab button not working 
Csharp :: how to print a word in C# 
Csharp :: how to make soft body OBJECT in unity 
Csharp :: ########## 
Csharp :: unity c# script for movement left and right 
Csharp :: c# create empty file if not exists 
Csharp :: unity convert pixels to units 
Csharp :: c# stringwriter encoding iso-8859-1 example 
Csharp :: Unity search all chidren of parent object 
Csharp :: c# open folder in explorer zugriff verweigert 
Csharp :: my custom file watcher 
Csharp :: C# list of unique values with group and counts 
Csharp :: afaik 
Csharp :: can a dictionary type use get set c# 
Csharp :: unity roam, chase, attack states 
Csharp :: properties vs field c# 
Csharp :: how to make continuous progress bar 
Csharp :: c# class reference 
Csharp :: wpf xaml group of buttons 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =