Skip to content

Commit

Permalink
Update README and LICENSE to make gh happy
Browse files Browse the repository at this point in the history
  • Loading branch information
db47h committed May 27, 2020
1 parent 9221919 commit ddc2814
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 32 deletions.
37 changes: 18 additions & 19 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
Copyright (c) 2020 Denis Bernard <[email protected]>. All rights reserved.
Copyright (c) 2020, Denis Bernard <[email protected]>.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ and an exactly rounded `Sqrt`. Other functions like Log will be implemented in a
future "math" sub-package. All results are rounded to the desired precision (no
manual rounding).

NaN values are not supported (like `big.Float`). In IEEE-754 terminology, NaNs
are `signaling NaNs`, that is when a NaN is generated as a result of an
operation, it causes a panic. Applications that need to handle NaNs can use Go's
built-in panic/recover machanism to handle these efficiently: NaNs cause a panic
with an ErrNaN whihc can be tested to distinguish NaNs from other causes of
panic.
NaN values are not directly supported (like in `big.Float`). They can be
considered as "signaling NaNs" in IEEE-754 terminology, that is when a NaN is
generated as a result of an operation, it causes a panic. Applications that need
to handle NaNs gracefully can use Go's built-in panic/recover machanism to
handle these efficiently: NaNs cause a panic with an ErrNaN which can be tested
to distinguish NaNs from other causes of panic.

Mantissae are always normalized, as a result, Decimals have a single possible
representation:

0.1 <= mantissa < 1; d = mantissa × 10**exponent

so there is no Quantize operation.
so there is no notion of scale and no Quantize operation.

There is no notion of "context". Context have not been implemented in this
package simply to keep the API in-line with math/big. Contexts are however so
There is no notion of "context" either. Contexts have not been implemented in
this package simply to keep the API in-line with math/big. They are however so
useful that they will be provided by a future sub-package.

## TODO's and upcoming features
Expand Down Expand Up @@ -111,7 +111,7 @@ Note that Eric's decimal uses a separate logic for decimals < 1e19 (mantissa
stored in a single uint64), which explains its impressive perfomance for low
precisions.

In additions, and subtractions the operands mantissae need to be aligned
In additions and subtractions the operands' mantissae need to be aligned
(shifted), this results in an additional multiplication by 10**shift. In
implementations that use a binary representation of the matissa, this is faster
for shifts < 19, but performance degrades as shifts get higher. With a decimal
Expand Down Expand Up @@ -172,13 +172,15 @@ and allocate temporary storage space if (and only if) necessary. Should this kin

## License

Simplified BSD license. See the LICENSE file at the root of the package tree.
Simplified BSD license. See the [LICENSE] file.

The decimal package reuses a lot of code from the Go standard library, governed
by a 3-Clause BSD license. See the LICENSE-go file.
by a 3-Clause BSD license. See the [LICENSE-go] file.

[godoc]: https://pkg.go.dev/github.com/db47h/decimal?tab=doc
[godocb]: https://img.shields.io/badge/go.dev-reference-blue
[eldecimal]: https://github.com/ericlagergren/decimal
[apd]: github.com/cockroachdb/apd
[spdec]: github.com/shopspring/decimal
[spdec]: github.com/shopspring/decimal
[LICENSE]: https://github.com/db47h/decimal/blob/master/LICENSE
[LICENSE-go]: https://github.com/db47h/decimal/blob/master/LICENSE-go

0 comments on commit ddc2814

Please sign in to comment.