File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
src/MongoDB.Bson/ObjectModel Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1523,6 +1523,25 @@ public Decimal128(Half value)
15231523 }
15241524#endif
15251525
1526+ /// <summary>
1527+ /// Initializes a new instance of the <see cref="Decimal128"/> struct.
1528+ /// </summary>
1529+ /// <param name="value">The value.</param>
1530+ [ CLSCompliant ( false ) ]
1531+ public Decimal128 ( sbyte value )
1532+ {
1533+ if ( value >= 0 )
1534+ {
1535+ _highBits = 0 ;
1536+ _lowBits = ( ulong ) value ;
1537+ }
1538+ else
1539+ {
1540+ _highBits = Flags . SignBit ;
1541+ _lowBits = value == sbyte . MinValue ? ( ulong ) sbyte . MaxValue + 1 : ( ulong ) - value ;
1542+ }
1543+ }
1544+
15261545 /// <summary>
15271546 /// Initializes a new instance of the <see cref="Decimal128"/> struct.
15281547 /// </summary>
@@ -1559,6 +1578,16 @@ public Decimal128(long value)
15591578 }
15601579 }
15611580
1581+ /// <summary>
1582+ /// Initializes a new instance of the <see cref="Decimal128"/> struct.
1583+ /// </summary>
1584+ /// <param name="value">The value.</param>
1585+ public Decimal128 ( byte value )
1586+ {
1587+ _highBits = 0 ;
1588+ _lowBits = value ;
1589+ }
1590+
15621591 /// <summary>
15631592 /// Initializes a new instance of the <see cref="Decimal128"/> struct.
15641593 /// </summary>
You can’t perform that action at this time.
0 commit comments