excel_to_code 0.2.6 → 0.2.7
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/src/compile/c/a.out +0 -0
- data/src/compile/c/excel_to_c_runtime.c +9 -0
- data/src/compile/c/excel_to_c_runtime_test.c +9 -0
- data/src/compile/c/map_formulae_to_c.rb +1 -0
- data/src/compile/ruby/map_formulae_to_ruby.rb +1 -0
- data/src/excel/excel_functions.rb +2 -0
- data/src/excel/excel_functions/exp.rb +10 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de50bb7417dea65e89b3e044864df9d88fe1bb7c
|
4
|
+
data.tar.gz: dbd11e7e284285b9f311ee6e4c983876d066a38c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e60e361d77daad8e9d4ce9ddc5ad3d483c3af24089d085440482502305cc45dfadadf416ab814ed8e66f0e41541e8cc3bfbeae9b560ebdd5c9fe67d766f2679
|
7
|
+
data.tar.gz: bb745e1c9a5e6dc3d9ecfcc2b52c70ea9da644e2fba18dbdacb0d6ee11e999e42f5976d559d2b2e876c8abdf6c7be1002053bf62546d4209d0466d3ae6915c9a
|
data/src/compile/c/a.out
CHANGED
Binary file
|
@@ -68,6 +68,7 @@ static ExcelValue left(ExcelValue string_v, ExcelValue number_of_characters_v);
|
|
68
68
|
static ExcelValue left_1(ExcelValue string_v);
|
69
69
|
static ExcelValue excel_log(ExcelValue number);
|
70
70
|
static ExcelValue excel_log_2(ExcelValue number, ExcelValue base);
|
71
|
+
static ExcelValue excel_exp(ExcelValue number);
|
71
72
|
static ExcelValue max(int number_of_arguments, ExcelValue *arguments);
|
72
73
|
static ExcelValue min(int number_of_arguments, ExcelValue *arguments);
|
73
74
|
static ExcelValue mmult(ExcelValue a_v, ExcelValue b_v);
|
@@ -311,6 +312,14 @@ static ExcelValue excel_log_2(ExcelValue number_v, ExcelValue base_v) {
|
|
311
312
|
return new_excel_number(log(n)/log(b));
|
312
313
|
}
|
313
314
|
|
315
|
+
static ExcelValue excel_exp(ExcelValue number_v) {
|
316
|
+
CHECK_FOR_PASSED_ERROR(number_v)
|
317
|
+
NUMBER(number_v, n)
|
318
|
+
CHECK_FOR_CONVERSION_ERROR
|
319
|
+
|
320
|
+
return new_excel_number(exp(n));
|
321
|
+
}
|
322
|
+
|
314
323
|
static ExcelValue excel_and(int array_size, ExcelValue *array) {
|
315
324
|
int i;
|
316
325
|
ExcelValue current_excel_value, array_result;
|
@@ -745,6 +745,15 @@ int test_functions() {
|
|
745
745
|
assert(excel_isnumber(TRUE).type == ExcelBoolean);
|
746
746
|
assert(excel_isnumber(TRUE).number == 0);
|
747
747
|
|
748
|
+
// Test the EXP function
|
749
|
+
assert(excel_exp(BLANK).number == 1);
|
750
|
+
assert(excel_exp(ZERO).number == 1);
|
751
|
+
assert(excel_exp(ONE).number == 2.718281828459045);
|
752
|
+
assert(excel_exp(new_excel_string("1")).number == 2.718281828459045);
|
753
|
+
assert(excel_exp(FALSE).number == 1);
|
754
|
+
assert(excel_exp(TRUE).number == 2.718281828459045);
|
755
|
+
assert(excel_exp(DIV0).type == ExcelError);
|
756
|
+
|
748
757
|
// Release memory
|
749
758
|
free_all_allocated_memory();
|
750
759
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excel_to_code
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Counsell, Green on Black Ltd
|
@@ -151,6 +151,7 @@ files:
|
|
151
151
|
- src/excel/excel_functions/excel_equal.rb
|
152
152
|
- src/excel/excel_functions/excel_if.rb
|
153
153
|
- src/excel/excel_functions/excel_match.rb
|
154
|
+
- src/excel/excel_functions/exp.rb
|
154
155
|
- src/excel/excel_functions/find.rb
|
155
156
|
- src/excel/excel_functions/hlookup.rb
|
156
157
|
- src/excel/excel_functions/iferror.rb
|