Skip to content

Commit dd622d9

Browse files
adyavanapalliBillWagner
authored andcommitted
Use simplified float syntax. (#464)
1 parent 3facc2f commit dd622d9

File tree

7 files changed

+15
-17
lines changed

7 files changed

+15
-17
lines changed

snippets/cpp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorDictionaryFloat/CPP/hashtable_ctordictionaryfloat.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ public ref class SamplesHashtable
5959
mySL->Add( "THIRD", "!" );
6060

6161
// Create a hash table using the default hash code provider and the default comparer.
62-
Hashtable^ myHT1 = gcnew Hashtable( mySL,(float).8 );
62+
Hashtable^ myHT1 = gcnew Hashtable( mySL, .8f );
6363

6464
// Create a hash table using the specified case-insensitive hash code provider and case-insensitive comparer.
65-
Hashtable^ myHT2 = gcnew Hashtable( mySL,(float).8,gcnew myCultureComparer() );
65+
Hashtable^ myHT2 = gcnew Hashtable( mySL, .8f, gcnew myCultureComparer() );
6666

6767
// Create a hash table using the specified KeyComparer.
6868
// The KeyComparer uses a case-insensitive hash code provider and a case-insensitive comparer,
6969
// which are based on the Turkish culture (tr-TR), where "I" is not the uppercase version of "i".
7070
CultureInfo^ myCul = gcnew CultureInfo( "tr-TR" );
71-
Hashtable^ myHT3 = gcnew Hashtable( mySL,(float).8, gcnew myCultureComparer( myCul ) );
71+
Hashtable^ myHT3 = gcnew Hashtable( mySL, .8f, gcnew myCultureComparer( myCul ) );
7272

7373
// Search for a key in each hash table.
7474
Console::WriteLine( "first is in myHT1: {0}", myHT1->ContainsKey( "first" ) );

snippets/cpp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorIntFloat/CPP/hashtable_ctorintfloat.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ public ref class SamplesHashtable
5252
static void Main()
5353
{
5454
// Create a hash table using the default comparer.
55-
Hashtable^ myHT1 = gcnew Hashtable(3, (float).8);
55+
Hashtable^ myHT1 = gcnew Hashtable(3, .8f);
5656
myHT1->Add("FIRST", "Hello");
5757
myHT1->Add("SECOND", "World");
5858
myHT1->Add("THIRD", "!");
5959

6060
// Create a hash table using the specified IEqualityComparer that uses
6161
// the CaseInsensitiveComparer.DefaultInvariant to determine equality.
62-
Hashtable^ myHT2 = gcnew Hashtable(3, (float).8, gcnew myCultureComparer());
62+
Hashtable^ myHT2 = gcnew Hashtable(3, .8f, gcnew myCultureComparer());
6363
myHT2->Add("FIRST", "Hello");
6464
myHT2->Add("SECOND", "World");
6565
myHT2->Add("THIRD", "!");
@@ -68,7 +68,7 @@ public ref class SamplesHashtable
6868
// the Turkish culture (tr-TR) where "I" is not the uppercase
6969
// version of "i".
7070
CultureInfo^ myCul = gcnew CultureInfo("tr-TR");
71-
Hashtable^ myHT3 = gcnew Hashtable(3, (float).8, gcnew myCultureComparer(myCul));
71+
Hashtable^ myHT3 = gcnew Hashtable(3, .8f, gcnew myCultureComparer(myCul));
7272
myHT3->Add("FIRST", "Hello");
7373
myHT3->Add("SECOND", "World");
7474
myHT3->Add("THIRD", "!");

snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorDictionaryFloat/CS/hashtable_ctordictionaryfloat.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,18 @@ public static void Main()
5353
mySL.Add("THIRD", "!");
5454

5555
// Create a hash table using the default comparer.
56-
Hashtable myHT1 = new Hashtable(mySL, (float).8);
56+
Hashtable myHT1 = new Hashtable(mySL, .8f);
5757

5858
// Create a hash table using the specified IEqualityComparer that uses
5959
// the CaseInsensitiveComparer.DefaultInvariant to determine equality.
60-
Hashtable myHT2 = new Hashtable(mySL, (float).8,
60+
Hashtable myHT2 = new Hashtable(mySL, .8f,
6161
new myCultureComparer());
6262

6363
// Create a hash table using an IEqualityComparer that is based on
6464
// the Turkish culture (tr-TR) where "I" is not the uppercase
6565
// version of "i".
6666
CultureInfo myCul = new CultureInfo("tr-TR");
67-
Hashtable myHT3 = new Hashtable(mySL, (float).8,
68-
new myCultureComparer(myCul));
67+
Hashtable myHT3 = new Hashtable(mySL, .8f, new myCultureComparer(myCul));
6968

7069
// Search for a key in each hash table.
7170
Console.WriteLine("first is in myHT1: {0}", myHT1.ContainsKey("first"));

snippets/csharp/VS_Snippets_CLR_System/system.Collections.Hashtable_ctorIntFloat/CS/hashtable_ctorintfloat.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ public static void Main()
4747
{
4848

4949
// Create a hash table using the default comparer.
50-
Hashtable myHT1 = new Hashtable(3, (float).8);
50+
Hashtable myHT1 = new Hashtable(3, .8f);
5151
myHT1.Add("FIRST", "Hello");
5252
myHT1.Add("SECOND", "World");
5353
myHT1.Add("THIRD", "!");
5454

5555
// Create a hash table using the specified IEqualityComparer that uses
5656
// the CaseInsensitiveComparer.DefaultInvariant to determine equality.
57-
Hashtable myHT2 = new Hashtable(3, (float).8, new myCultureComparer());
57+
Hashtable myHT2 = new Hashtable(3, .8f, new myCultureComparer());
5858
myHT2.Add("FIRST", "Hello");
5959
myHT2.Add("SECOND", "World");
6060
myHT2.Add("THIRD", "!");
@@ -63,8 +63,7 @@ public static void Main()
6363
// the Turkish culture (tr-TR) where "I" is not the uppercase
6464
// version of "i".
6565
CultureInfo myCul = new CultureInfo("tr-TR");
66-
Hashtable myHT3 = new Hashtable(3, (float).8,
67-
new myCultureComparer(myCul));
66+
Hashtable myHT3 = new Hashtable(3, .8f, new myCultureComparer(myCul));
6867

6968
myHT3.Add("FIRST", "Hello");
7069
myHT3.Add("SECOND", "World");

snippets/csharp/VS_Snippets_Misc/astoria northwind service/cs/northwind2.svc.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void ProcessingPipeline_ProcessingChangeset(object sender, EventArgs e)
7171

7272
// Order_Detail item = (Order_Detail)entity;
7373

74-
// item.Discount = (float)0.5;
74+
// item.Discount = 0.5f;
7575

7676
// this.CurrentDataSource.SaveChanges();
7777

snippets/csharp/VS_Snippets_VBCSharp/VbPowerPacksShapeScale/CS/ShapeScale.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ private void ovalShape1_Click(System.Object sender, System.EventArgs e)
2727
}
2828
else
2929
{
30-
ovalShape1.Scale(new SizeF((float)0.5, ((float)0.333)));
30+
ovalShape1.Scale(new SizeF(0.5f, 0.333f));
3131
state = false;
3232
}
3333
}

snippets/csharp/VS_Snippets_Winforms/TabControl.RightAlignedTabs/CS/Form1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private void tabControl1_DrawItem(Object sender, System.Windows.Forms.DrawItemEv
4444
}
4545

4646
// Use our own font.
47-
Font _tabFont = new Font("Arial", (float)10.0, FontStyle.Bold, GraphicsUnit.Pixel);
47+
Font _tabFont = new Font("Arial", 10.0f, FontStyle.Bold, GraphicsUnit.Pixel);
4848

4949
// Draw string. Center the text.
5050
StringFormat _stringFlags = new StringFormat();

0 commit comments

Comments
 (0)