fractify 1.0.3 → 1.0.4
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/Gemfile.lock +1 -1
- data/lib/fractify/calculator.rb +5 -1
- data/lib/fractify/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6f360f46b9f64bdefe499c64ee0e1d93eea97553b84773738750ddb1a86c82ea
|
|
4
|
+
data.tar.gz: 69f7434c9c6200c0a8e154b0bb1417daf914d3473ab2008bc157478d3196cdc9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 472d8797cfdc705f18fb2d09f59d22ad2620dc46b108de8cb2d99cf9fc4d92353d04de4fbb356ba5b811166d82f2425d035f62ab72d145c7630184218cf46cd5
|
|
7
|
+
data.tar.gz: 22701631e2c119f1a061a492a0dded5155046d1b56c27f0d9469c4fc448be15e5f73af03add8836321d9133112cca9fa9a76f0251354d07948e3c77ed58ca817
|
data/Gemfile.lock
CHANGED
data/lib/fractify/calculator.rb
CHANGED
|
@@ -110,6 +110,8 @@ module Fractify
|
|
|
110
110
|
fraction = op.to_left / op.to_right
|
|
111
111
|
when ':'
|
|
112
112
|
fraction = op.to_left / op.to_right
|
|
113
|
+
when '÷'
|
|
114
|
+
fraction = op.to_left / op.to_right
|
|
113
115
|
when '^'
|
|
114
116
|
fraction = op.to_left**op.to_right
|
|
115
117
|
end
|
|
@@ -226,6 +228,8 @@ module Fractify
|
|
|
226
228
|
current_rank + 1
|
|
227
229
|
when ':'
|
|
228
230
|
current_rank + 1
|
|
231
|
+
when '÷'
|
|
232
|
+
current_rank + 1
|
|
229
233
|
when '^'
|
|
230
234
|
current_rank + 2
|
|
231
235
|
else
|
|
@@ -234,7 +238,7 @@ module Fractify
|
|
|
234
238
|
end
|
|
235
239
|
|
|
236
240
|
def char_is_an_operator(char)
|
|
237
|
-
%w[+ - * / : ^].include? char
|
|
241
|
+
%w[+ - * / : ÷ ^].include? char
|
|
238
242
|
end
|
|
239
243
|
|
|
240
244
|
def find_operator_with_left(operators, fraction)
|
data/lib/fractify/version.rb
CHANGED