Skip to content

Commit

Permalink
Version 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
peteroupc committed Nov 21, 2014
1 parent 9e619ab commit 3fb80fe
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 100 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ project, add the following to the `dependencies` section in your `pom.xml` file:
<dependency>
<groupId>com.upokecenter</groupId>
<artifactId>cbor</artifactId>
<version>2.0.0</version>
<version>2.1.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.upokecenter</groupId>
<artifactId>cbor</artifactId>
<packaging>jar</packaging>
<version>2.1.0-SNAPSHOT</version>
<version>2.1.0</version>
<name>CBOR</name>
<description>
A Java implementation of Concise Binary Object Representation (CBOR), a general-purpose binary data format defined in RFC 7049. According to that RFC, CBOR's data model "is an extended version of the JSON data model", supporting many more types of data than JSON. This implementation was written by Peter O. and is released to the Public Domain under the CC0 Declaration.
Expand Down
78 changes: 24 additions & 54 deletions src/main/java/com/upokecenter/util/ExtendedDecimal.java
Original file line number Diff line number Diff line change
Expand Up @@ -3109,15 +3109,7 @@ public static ExtendedDecimal PI(PrecisionContext ctx) {

/**
* Returns a number similar to this number but with the decimal point moved to
* the right. <param name='ctx'>A precision context to control
* precision, rounding, and exponent range of the result. If HasFlags of
* the context is true, will also store the flags resulting from the
* operation (the flags are in addition to the pre-existing flags). Can
* be null.</param>
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* the right.
* @param places A 32-bit signed integer.
* @return An ExtendedDecimal object.
*/
Expand All @@ -3127,17 +3119,12 @@ public ExtendedDecimal MovePointLeft(int places) {

/**
* Returns a number similar to this number but with the decimal point moved to
* the left. <param name='ctx'>A precision context to control precision,
* rounding, and exponent range of the result. If HasFlags of the
* context is true, will also store the flags resulting from the
* operation (the flags are in addition to the pre-existing flags). Can
* be null.</param>
* the left.
* @param places A 32-bit signed integer.
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* @param places A 32-bit signed integer.
* @param ctx A PrecisionContext object.
* @return An ExtendedDecimal object.
*/
public ExtendedDecimal MovePointLeft(int places, PrecisionContext ctx) {
Expand All @@ -3146,15 +3133,7 @@ public ExtendedDecimal MovePointLeft(int places, PrecisionContext ctx) {

/**
* Returns a number similar to this number but with the decimal point moved to
* the left. <param name='ctx'>A precision context to control precision,
* rounding, and exponent range of the result. If HasFlags of the
* context is true, will also store the flags resulting from the
* operation (the flags are in addition to the pre-existing flags). Can
* be null.</param>
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* the left.
* @param bigPlaces A BigInteger object.
* @return An ExtendedDecimal object.
*/
Expand All @@ -3164,17 +3143,12 @@ public ExtendedDecimal MovePointLeft(BigInteger bigPlaces) {

/**
* Returns a number similar to this number but with the decimal point moved to
* the left. <param name='ctx'>A precision context to control precision,
* rounding, and exponent range of the result. If HasFlags of the
* context is true, will also store the flags resulting from the
* operation (the flags are in addition to the pre-existing flags). Can
* be null.</param>
* the left.
* @param bigPlaces A BigInteger object.
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* @param bigPlaces A BigInteger object.
* @param ctx A PrecisionContext object.
* @return An ExtendedDecimal object.
*/
public ExtendedDecimal MovePointLeft(
Expand All @@ -3201,7 +3175,10 @@ public ExtendedDecimal MovePointRight(int places) {
* Returns a number similar to this number but with the decimal point moved to
* the right.
* @param places A 32-bit signed integer.
* @param ctx A PrecisionContext object.
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* @return An ExtendedDecimal object.
*/
public ExtendedDecimal MovePointRight(int places, PrecisionContext ctx) {
Expand All @@ -3210,15 +3187,7 @@ public ExtendedDecimal MovePointRight(int places, PrecisionContext ctx) {

/**
* Returns a number similar to this number but with the decimal point moved to
* the right. <param name='ctx'>A precision context to control
* precision, rounding, and exponent range of the result. If HasFlags of
* the context is true, will also store the flags resulting from the
* operation (the flags are in addition to the pre-existing flags). Can
* be null.</param>
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* the right.
* @param bigPlaces A BigInteger object.
* @return An ExtendedDecimal object.
*/
Expand All @@ -3230,7 +3199,10 @@ public ExtendedDecimal MovePointRight(BigInteger bigPlaces) {
* Returns a number similar to this number but with the decimal point moved to
* the right.
* @param bigPlaces A BigInteger object.
* @param ctx A PrecisionContext object.
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* @return A number whose scale is increased by {@code bigPlaces} , but not to
* more than 0.
*/
Expand Down Expand Up @@ -3272,23 +3244,18 @@ public ExtendedDecimal ScaleByPowerOfTen(int places) {
/**
* Returns a number similar to this number but with the scale adjusted.
* @param places A 32-bit signed integer.
* @param ctx A PrecisionContext object.
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* @return An ExtendedDecimal object.
*/
public ExtendedDecimal ScaleByPowerOfTen(int places, PrecisionContext ctx) {
return this.ScaleByPowerOfTen(BigInteger.valueOf(places), ctx);
}

/**
* Returns a number similar to this number but with the scale adjusted. <param
* name='ctx'>A precision context to control precision, rounding, and
* exponent range of the result. If HasFlags of the context is true,
* will also store the flags resulting from the operation (the flags are
* in addition to the pre-existing flags). Can be null.</param>
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* Returns a number similar to this number but with the scale adjusted.
* @param bigPlaces A BigInteger object.
* @return An ExtendedDecimal object.
*/
Expand All @@ -3299,7 +3266,10 @@ public ExtendedDecimal ScaleByPowerOfTen(BigInteger bigPlaces) {
/**
* Returns a number similar to this number but with its scale adjusted.
* @param bigPlaces A BigInteger object.
* @param ctx A PrecisionContext object.
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* @return A number whose scale is increased by {@code bigPlaces} .
*/
public ExtendedDecimal ScaleByPowerOfTen(
Expand Down
63 changes: 19 additions & 44 deletions src/main/java/com/upokecenter/util/ExtendedFloat.java
Original file line number Diff line number Diff line change
Expand Up @@ -2272,15 +2272,7 @@ public static ExtendedFloat PI(PrecisionContext ctx) {

/**
* Returns a number similar to this number but with the radix point moved to
* the left. <param name='ctx'>A precision context to control precision,
* rounding, and exponent range of the result. If HasFlags of the
* context is true, will also store the flags resulting from the
* operation (the flags are in addition to the pre-existing flags). Can
* be null.</param>
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* the left.
* @param places A 32-bit signed integer.
* @return An ExtendedFloat object.
*/
Expand All @@ -2290,17 +2282,12 @@ public ExtendedFloat MovePointLeft(int places) {

/**
* Returns a number similar to this number but with the radix point moved to
* the left. <param name='ctx'>A precision context to control precision,
* rounding, and exponent range of the result. If HasFlags of the
* context is true, will also store the flags resulting from the
* operation (the flags are in addition to the pre-existing flags). Can
* be null.</param>
* the left.
* @param places A 32-bit signed integer.
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* @param places A 32-bit signed integer.
* @param ctx A PrecisionContext object.
* @return An ExtendedFloat object.
*/
public ExtendedFloat MovePointLeft(int places, PrecisionContext ctx) {
Expand All @@ -2309,15 +2296,7 @@ public ExtendedFloat MovePointLeft(int places, PrecisionContext ctx) {

/**
* Returns a number similar to this number but with the radix point moved to
* the left. <param name='ctx'>A precision context to control precision,
* rounding, and exponent range of the result. If HasFlags of the
* context is true, will also store the flags resulting from the
* operation (the flags are in addition to the pre-existing flags). Can
* be null.</param>
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* the left.
* @param bigPlaces A BigInteger object.
* @return An ExtendedFloat object.
*/
Expand All @@ -2329,7 +2308,10 @@ public ExtendedFloat MovePointLeft(BigInteger bigPlaces) {
* Returns a number similar to this number but with the radix point moved to
* the left.
* @param bigPlaces A BigInteger object.
* @param ctx A PrecisionContext object.
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* @return An ExtendedFloat object.
*/
public ExtendedFloat MovePointLeft(
Expand All @@ -2356,7 +2338,10 @@ public ExtendedFloat MovePointRight(int places) {
* Returns a number similar to this number but with the radix point moved to
* the right.
* @param places A 32-bit signed integer.
* @param ctx A PrecisionContext object.
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* @return An ExtendedFloat object.
*/
public ExtendedFloat MovePointRight(int places, PrecisionContext ctx) {
Expand All @@ -2375,17 +2360,12 @@ public ExtendedFloat MovePointRight(BigInteger bigPlaces) {

/**
* Returns a number similar to this number but with the radix point moved to
* the right. <param name='ctx'>A precision context to control
* precision, rounding, and exponent range of the result. If HasFlags of
* the context is true, will also store the flags resulting from the
* operation (the flags are in addition to the pre-existing flags). Can
* be null.</param>
* the right.
* @param bigPlaces A BigInteger object.
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* @param bigPlaces A BigInteger object.
* @param ctx A PrecisionContext object.
* @return A number whose scale is increased by {@code bigPlaces} , but not to
* more than 0.
*/
Expand Down Expand Up @@ -2427,23 +2407,18 @@ public ExtendedFloat ScaleByPowerOfTwo(int places) {
/**
* Returns a number similar to this number but with the scale adjusted.
* @param places A 32-bit signed integer.
* @param ctx A PrecisionContext object.
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* @return An ExtendedDecimal object.
*/
public ExtendedFloat ScaleByPowerOfTwo(int places, PrecisionContext ctx) {
return this.ScaleByPowerOfTwo(BigInteger.valueOf(places), ctx);
}

/**
* Returns a number similar to this number but with the scale adjusted. <param
* name='ctx'>A precision context to control precision, rounding, and
* exponent range of the result. If HasFlags of the context is true,
* will also store the flags resulting from the operation (the flags are
* in addition to the pre-existing flags). Can be null.</param>
* @param ctx A precision context to control precision, rounding, and exponent
* range of the result. If HasFlags of the context is true, will also
* store the flags resulting from the operation (the flags are in
* addition to the pre-existing flags). Can be null.
* Returns a number similar to this number but with the scale adjusted.
* @param bigPlaces A BigInteger object.
* @return An ExtendedDecimal object.
*/
Expand Down

0 comments on commit 3fb80fe

Please sign in to comment.