* Change function name from RoundUp -> RoundCeil, RoundDown -> RoundFloor
* Add a new RoundUp and RoundDown methods
* Modify the docs of RoundUp and RoundDown
Since trailing 0 digits after the decimal point are trimmed, intString
becomes an empty string when there is no digit before the decimal point
and all digits after the decimal point is 0, causing big.Int SetString
to fail because there is no string to parse.
Fix#134.
* Make NewFromFloat respect the precision of the input
Restores the previous behaviour where input converted from float is truncated at the precision of the float.
The precision is depending on the actual value. Simply making it 15 digits would make it faster, but would in some cases lose some precision. So the code from the stdlib that does this calculation (very well) has been included.
Lots of good articles here: https://www.exploringbinary.com/decimal-precision-of-binary-floating-point-numbers/
Performance is around the same as the previous string roundtrip since it basically does the same, but allocations are a bit less.
`BenchmarkNewFromStringFloat` is the old method, `BenchmarkNewFromFloat` is the new.
```
BenchmarkNewFromFloatWithExponent-8 10000000 260 ns/op 174 B/op 4 allocs/op
BenchmarkNewFromFloat-8 2000000 744 ns/op 90 B/op 2 allocs/op
BenchmarkNewFromStringFloat-8 2000000 822 ns/op 258 B/op 6 allocs/op
```
* Update Sin/Tan/Cos tests.
* Added Atan method
* added sin and cos methods
* added tests for atan, sin, and cos
* tan method and test
* potentinal fix for './decimal_test.go:261:6: d declared but not used' error thrown by the tip version Travis CI tests + corrected comment in decimal.go
* Additional (and some breaking) tests for NewFromFloatWithExponent
* Addressing tests for NewFromFloatWithExponent
* Naming cosmetic correction
* removing unused code
* Improving FromFloatWithExponent
* Tests for exact float representation added
* Exact float representation in FromFloat
* Adding breaking test for NewFromFloat
* Fast path in FromFloat is unreliable, fixing it
* Addressing special meaning of zero exponent in float64
* NewFromFloatWithExponent: subnormals support
* NewFromFloatWithExponent: just a few additional test cases
* NewFromFloat: documentation update
* NewFromFloatWithExponent: optimization and some documentation
* NewFromFloatWithExponent: optimizations
* NewFromFloatWithExponent: optimizations
* Subnormal test added
* Float64: adding tests
* Additional (and some breaking) tests for NewFromFloatWithExponent
* Addressing tests for NewFromFloatWithExponent
* Naming cosmetic correction
* removing unused code
* Improving FromFloatWithExponent
* Tests for exact float representation added
* Exact float representation in FromFloat
* Adding breaking test for NewFromFloat
* Fast path in FromFloat is unreliable, fixing it
* Addressing special meaning of zero exponent in float64
* NewFromFloatWithExponent: subnormals support
* NewFromFloatWithExponent: just a few additional test cases
* NewFromFloat: documentation update
* NewFromFloatWithExponent: optimization and some documentation
* NewFromFloatWithExponent: optimizations
* NewFromFloatWithExponent: optimizations