hpsqrt 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/hpsqrt.rb +14 -0
- data/lib/hpsqrt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ca59546fcdd36aa56c05bdc9a8388939840c031841f2d6e19d9066a683a94e9
|
|
4
|
+
data.tar.gz: 31aec41930aa5379e99efc3dfff64d4617029a74a76838a2a821596ee72a397f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe621d3395abf9de010ca350af3a3dc4ce6e37e1ab07fb9a0cb013cc567b38c5f71094e2443b55037858bcc29dd460067ca0b26548c9d18044761d1a7cf1e4f6
|
|
7
|
+
data.tar.gz: 271b68f2c4139454b5665193837c6da825d292227fc14b4450efc70c47678389666ea9633c4e9e00ac2a6109ac2e42778bc7d639bc80dfce70cdf4f3d9f6e959
|
data/README.md
CHANGED
|
@@ -20,7 +20,7 @@ Or install it yourself as:
|
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
High precision calculation:
|
|
24
24
|
|
|
25
25
|
require 'hpsqrt/core_ext'
|
|
26
26
|
|
|
@@ -39,6 +39,10 @@ Calculation:
|
|
|
39
39
|
p (Sqrt(7) + Sqrt(11)) * (Sqrt(7) - Sqrt(11))
|
|
40
40
|
# => -4.0+0.0i
|
|
41
41
|
|
|
42
|
+
Support operators:
|
|
43
|
+
|
|
44
|
+
+, -, *, /, %, **, ==
|
|
45
|
+
|
|
42
46
|
Type casting:
|
|
43
47
|
|
|
44
48
|
require 'hpsqrt/core_ext'
|
data/lib/hpsqrt.rb
CHANGED
|
@@ -117,6 +117,20 @@ class HpSqrt < Numeric
|
|
|
117
117
|
end
|
|
118
118
|
end
|
|
119
119
|
|
|
120
|
+
def rect
|
|
121
|
+
to_c.rect
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def polar
|
|
125
|
+
to_c.polar
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def arg
|
|
129
|
+
to_c.arg
|
|
130
|
+
end
|
|
131
|
+
alias_method :angle, :arg
|
|
132
|
+
alias_method :phase, :arg
|
|
133
|
+
|
|
120
134
|
def to_c
|
|
121
135
|
@terms.map {|t, c|
|
|
122
136
|
t.number * Math.sqrt(Complex(t.sqrt)) * c
|
data/lib/hpsqrt/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hpsqrt
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yoshida Tetsuya
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-06-
|
|
11
|
+
date: 2019-06-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|