Skip to content

Commit e7b62e1

Browse files
committed
Add conversions example to main examples page
1 parent 3958fbd commit e7b62e1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

doc/modules/ROOT/pages/examples.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,30 @@ Decimal Result: 100
6969
....
7070
====
7171
72+
[#examples_conversions]
73+
== Conversions
74+
75+
[#examples_binary_floating_conversions]
76+
=== Binary Floating Point Conversions
77+
78+
.This https://github.com/cppalliance/decimal/blob/develop/examples/binary_float_conversions.cpp[example] shows show to construct a binary floating point value from decimal type and vice versa
79+
====
80+
[source,c++]
81+
----
82+
include::example$binary_float_conversions.cpp[]
83+
----
84+
85+
.Expected Output:
86+
....
87+
Decimal QNAN converts to double QNAN
88+
Decimal INFINITY converts to double INFINITY
89+
decimal64_t pi: 3.141592653589793
90+
double pi: 3.141592653589793
91+
Converted pi: 3.141592653589793
92+
decimal32_t pi: 3.141593
93+
....
94+
====
95+
7296
[#examples_promotion]
7397
== Promotion and Mixed Decimal Arithmetic
7498

0 commit comments

Comments
 (0)