.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BSON_DECIMAL128_T" "3" "Apr 02, 2024" "1.26.2" "libbson" .sp BSON Decimal128 Abstraction .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX #include #define BSON_DECIMAL128_STRING 43 #define BSON_DECIMAL128_INF \(dqInfinity\(dq #define BSON_DECIMAL128_NAN \(dqNaN\(dq typedef struct { #if BSON_BYTE_ORDER == BSON_LITTLE_ENDIAN uint64_t low; uint64_t high; #elif BSON_BYTE_ORDER == BSON_BIG_ENDIAN uint64_t high; uint64_t low; #endif } bson_decimal128_t; .EE .UNINDENT .UNINDENT .SH DESCRIPTION .sp The \fI\%bson_decimal128_t\fP structure represents the IEEE\-754 Decimal128 data type. The type \fBbson_decimal128_t\fP is an aggregate that contains two \fBuint64_t\fPs, named \fBhigh\fP and \fBlow\fP\&. The declaration and layout order between them depends on the endian order of the target platform: \fBlow\fP will always correspond to the low\-order bits of the Decimal128 object, while \fBhigh\fP corresponds to the high\-order bits. The \fBbson_decimal128_t\fP always has a size of sixteen (\fB16\fP), and can be bit\-cast to/from a \fB_Decimal128\fP\&. .SH EXAMPLE .INDENT 0.0 .INDENT 3.5 .sp .EX #include #include int main (int argc, char *argv[]) { char string[BSON_DECIMAL128_STRING]; bson_decimal128_t decimal128; bson_decimal128_from_string (\(dq100.00\(dq, &decimal128); bson_decimal128_to_string (&decimal128, string); printf (\(dqDecimal128 value: %s\en\(dq, string); return 0; } .EE .UNINDENT .UNINDENT .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .