Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions OpenCL_C.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1804,13 +1804,13 @@ specified by <<C99-spec,section 6.3 of the C99 Specification>>.
When converting from a floating-point type to integer type, the behavior is
implementation-defined.

Conversions to integer type may opt to convert using the optional saturated
Conversions to integer types may opt to convert using the optional saturated
mode by appending the `_sat` modifier to the conversion function name.
When in saturated mode, values that are outside the representable range
shall clamp to the nearest representable value in the destination format.
(NaN should be converted to 0).
are clamped to the nearest representable value in the destination format,
and NaN is converted to zero.

Conversions to floating-point type shall conform to IEEE-754 rounding rules.
Conversions to floating-point types conform to IEEE-754 rounding rules.
The `_sat` modifier may not be used for conversions to floating-point
formats.

Expand All @@ -1824,7 +1824,7 @@ Example 1:
----------
short4 s;

// negative values clamped to 0
// negative values clamped to zero
ushort4 u = convert_ushort4_sat( s );

// values > CHAR_MAX converted to CHAR_MAX
Expand All @@ -1843,7 +1843,7 @@ float4 f;
int4 i = convert_int4( f );

// values > INT_MAX clamp to INT_MAX, values < INT_MIN clamp
// to INT_MIN. NaN should produce 0.
// to INT_MIN, and NaN is converted to zero
// The _rtz_ rounding mode is used to produce the integer values.
int4 i2 = convert_int4_sat( f );

Expand Down
12 changes: 6 additions & 6 deletions man/static/convert_T.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ specified by <<C99-spec,section 6.3 of the C99 Specification>>.
When converting from a floating-point type to integer type, the behavior is
implementation-defined.

Conversions to integer type may opt to convert using the optional saturated
Conversions to integer types may opt to convert using the optional saturated
mode by appending the _sat modifier to the conversion function name.
When in saturated mode, values that are outside the representable range
shall clamp to the nearest representable value in the destination format.
(NaN should be converted to 0).
are clamped to the nearest representable value in the destination format,
and NaN is converted to zero.

Conversions to floating-point type shall conform to IEEE-754 rounding rules.
Conversions to floating-point types conform to IEEE-754 rounding rules.
The `_sat` modifier may not be used for conversions to floating-point
formats.

Expand All @@ -159,7 +159,7 @@ Example 1:
----------
short4 s;

// negative values clamped to 0
// negative values clamped to zero
ushort4 u = convert_ushort4_sat( s );

// values > CHAR_MAX converted to CHAR_MAX
Expand All @@ -178,7 +178,7 @@ float4 f;
int4 i = convert_int4( f );

// values > INT_MAX clamp to INT_MAX, values < INT_MIN clamp
// to INT_MIN. NaN should produce 0.
// to INT_MIN, and NaN is converted to zero
// The _rtz_ rounding mode is used to produce the integer values.
int4 i2 = convert_int4_sat( f );

Expand Down