Share via


Truncate Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Calculates the integral part of a specified double-precision floating-point number.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Shared Function Truncate ( _
    d As Double _
) As Double
public static double Truncate(
    double d
)
public:
static double Truncate(
    double d
)
static member Truncate : 
        d:float -> float 
public static function Truncate(
    d : double
) : double

Parameters

Return Value

Type: System. . :: . .Double
The integral part of d; that is, the number that remains after any fractional digits have been discarded, or one of the values listed in the following table.

d

Return value

NaN

NaN

NegativeInfinity

NegativeInfinity

PositiveInfinity

PositiveInfinity

Remarks

Truncate rounds d to the nearest integer towards zero.

.NET Framework Security

See Also

Reference

Math Class

System Namespace