qlang 0.0.27182121 → 0.0.27182122
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qlang/iq.rb +8 -4
- data/lib/qlang/version.rb +1 -1
- data/test/interpreter/test_limit.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6885aa7657d2db7e9131719cd1a133dda8c5228
|
4
|
+
data.tar.gz: d1e8488742ffdb7a14dc5bc8c6781735767ee85f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92161ba8353ba43e665489e568755f1c0152bbb3a243de383ddbd6efd114873588ac7fa3203a77a41ab9889b3f0b0fb1bace053187c18ccbcb98ebefca479f05
|
7
|
+
data.tar.gz: 576b83c544abbc8335edfc353571266e74cbf52fa9dba70e3ca31f49d183809ba1e1eb916e02386bbf6095525df3252dfa4804c385c7d7100e358b71036df954
|
data/lib/qlang/iq.rb
CHANGED
@@ -25,13 +25,17 @@ module Qlang
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def self.optimize_output(ruby_obj)
|
28
|
+
|
28
29
|
case ruby_obj
|
29
30
|
when Matrix, Vector, Dydx::Algebra::Formula
|
30
31
|
ruby_obj.to_q
|
31
|
-
when
|
32
|
-
|
33
|
-
|
34
|
-
'-oo'
|
32
|
+
when Numeric
|
33
|
+
# TODO: I know you wanna way..
|
34
|
+
if ruby_obj > 10000.0 then 'oo'
|
35
|
+
elsif ruby_obj < -10000.0 then '-oo'
|
36
|
+
elsif ruby_obj.abs < Float::EPSILON then '0.0'
|
37
|
+
else ruby_obj.to_s.equalize!
|
38
|
+
end
|
35
39
|
else
|
36
40
|
str = ruby_obj.to_s
|
37
41
|
str.equalize!
|
data/lib/qlang/version.rb
CHANGED