Files
cppdraft_translate/cppdraft/conv/double.md
2025-10-25 03:02:53 +03:00

39 lines
1.3 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[conv.double]
# 7 Expressions [[expr]](./#expr)
## 7.3 Standard conversions [[conv]](conv#double)
### 7.3.10 Floating-point conversions [conv.double]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/expressions.tex#L967)
A prvalue of floating-point type can be converted to a prvalue of
another floating-point type
with a greater or equal conversion rank ([[conv.rank]](conv.rank "6.9.6Conversion ranks"))[.](#1.sentence-1)
A prvalue of standard floating-point type can be converted to
a prvalue of another standard floating-point type[.](#1.sentence-2)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/expressions.tex#L975)
If the source value can be exactly
represented in the destination type, the result of the conversion is
that exact representation[.](#2.sentence-1)
If the source value is between two adjacent
destination values, the result of the conversion is animplementation-defined choice of either of those values[.](#2.sentence-2)
Otherwise, the behavior is undefined[.](#2.sentence-3)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/expressions.tex#L983)
The conversions allowed as floating-point promotions are excluded from
the set of floating-point conversions[.](#3.sentence-1)