简体   繁体   中英

What is equivalent data type of float[ ] in vb.net?

以下代码的vb.net等效语句是什么?

`float[] widths = new float[] { 1f, 1f, 1f };` 

Dim widths() as Single = {1.0f, 1.0f, 1.0f}

http://msdn.microsoft.com/en-us/library/y13tek7e.aspx

float type accessed with name Single in Visual Basic. float is Visual C# keyword only.

Define an array of System.Single .

You can try to use Single

Dim widths() as Single = {1.0f, 1.0f, 1.0f}

Use the Single data type to contain floating-point values that do not require the full data width of Double. In some cases the common language runtime might be able to pack your Single variables closely together and save memory consumption.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM