Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C#

float: practical reference

float: practical reference: float is a 32-bit IEEE 754 binary floating-point type with about seven decimal digits of precision.

Version: C# built-in type reference; .NET 10 runtime

Syntax

float value

float is a 32-bit IEEE 754 binary floating-point type with about seven decimal digits of precision.

Use it in graphics and large arrays when memory matters more than double precision.

A literal needs the f suffix, and accumulation quickly loses precision.

NaN, infinity, subnormal values, and signed zero require deliberate handling.

The complete program actually uses float; its exact expected stdout is System.Single.

Examples

using System;

Console.WriteLine(typeof(float).FullName);

Result

System.Single

The complete program actually uses `float`; its exact expected stdout is `System.Single`.

Sources