diff options
author | Antonio Giovanni Colombo <azc100@gmail.com> | 2021-02-01 10:18:00 +0100 |
---|---|---|
committer | Antonio Giovanni Colombo <azc100@gmail.com> | 2021-02-01 10:18:00 +0100 |
commit | 2dbf19a6bcf289c1cf4c309f15f1a33aa469de93 (patch) | |
tree | ae5834f9aa8ddcfe5c451316cdc41334daea1a1a | |
parent | 9c81550ac0f386929462a200e57a1dbe0953fe10 (diff) | |
download | egawk-2dbf19a6bcf289c1cf4c309f15f1a33aa469de93.tar.gz egawk-2dbf19a6bcf289c1cf4c309f15f1a33aa469de93.tar.bz2 egawk-2dbf19a6bcf289c1cf4c309f15f1a33aa469de93.zip |
modified for udpates to the gen-float-table programs
-rw-r--r-- | doc/it/ChangeLog | 4 | ||||
-rwxr-xr-x | doc/it/gawktexi.in | 94 |
2 files changed, 51 insertions, 47 deletions
diff --git a/doc/it/ChangeLog b/doc/it/ChangeLog index 2a9311d8..83ed6247 100644 --- a/doc/it/ChangeLog +++ b/doc/it/ChangeLog @@ -1,3 +1,7 @@ +2021-02-01 Antonio Giovanni Colombo <azc100@gmail.com> + + * gawktexi.in: Updated. + 2021-01-25 Antonio Giovanni Colombo <azc100@gmail.com> * gawktexi.in: Updated. diff --git a/doc/it/gawktexi.in b/doc/it/gawktexi.in index 35a806d2..e05abc4b 100755 --- a/doc/it/gawktexi.in +++ b/doc/it/gawktexi.in @@ -35854,36 +35854,36 @@ i valori di infinito e quelli NaN. @ignore @c file eg/test-programs/gen-float-table.awk function eq(left, right) -{ +@{ return left == right -} +@} function ne(left, right) -{ +@{ return left != right -} +@} function lt(left, right) -{ +@{ return left < right -} +@} function le(left, right) -{ +@{ return left <= right -} +@} function gt(left, right) -{ +@{ return left > right -} +@} function ge(left, right) -{ +@{ return left >= right -} +@} -BEGIN { +BEGIN @{ nan = sqrt(-1) inf = -log(0) split("== != < <= > >=", names) @@ -35897,21 +35897,21 @@ BEGIN { compare[4] = values[3] = -log(0.0) # inf compare[5] = values[4] = log(0.0) # -inf - for (i = 1; i in values; i++) { - for (j = 1; j in compare; j++) { - for (k = 1; k in names; k++) { + for (i = 1; i in values; i++) @{ + for (j = 1; j in compare; j++) @{ + for (k = 1; k in names; k++) @{ the_func = funcs[k] printf("%g %s %g -> %s\n", values[i], names[k], compare[j], - @the_func(values[i], compare[j]) ? - "true" : "false"); - } + @@the_func(values[i], compare[j]) ? + "True" : "False"); + @} printf("\n"); - } - } -} + @} + @} +@} @c endfile @end ignore @@ -35922,9 +35922,9 @@ BEGIN { #include <stdbool.h> #define def_func(name, op) \ - bool name(double left, double right) { \ + bool name(double left, double right) @{ \ return left op right; \ - } + @} def_func(eq, ==) def_func(ne, !=) @@ -35933,50 +35933,50 @@ def_func(le, <=) def_func(gt, >) def_func(ge, >=) -struct { +struct @{ const char *name; bool (*func)(double left, double right); -} functions[] = { - { "==", eq }, - { "!=", ne }, - { "< ", lt }, - { "<=", le }, - { "> ", gt }, - { ">=", ge }, - { 0, 0 } -}; +@} functions[] = @{ + @{ "==", eq @}, + @{ "!=", ne @}, + @{ "< ", lt @}, + @{ "<=", le @}, + @{ "> ", gt @}, + @{ ">=", ge @}, + @{ 0, 0 @} +@}; int main() -{ - double values[] = { +@{ + double values[] = @{ -sqrt(-1), // nan sqrt(-1), // -nan -log(0.0), // inf log(0.0) // -inf - }; - double compare[] = { 2.0, + @}; + double compare[] = @{ 2.0, -sqrt(-1), // nan sqrt(-1), // -nan -log(0.0), // inf log(0.0) // -inf - }; + @}; int i, j, k; - for (i = 0; i < 4; i++) { - for (j = 0; j < 5; j++) { - for (k = 0; functions[k].name != NULL; k++) { + for (i = 0; i < 4; i++) @{ + for (j = 0; j < 5; j++) @{ + for (k = 0; functions[k].name != NULL; k++) @{ printf("%g %s %g -> %s\n", values[i], functions[k].name, compare[j], - functions[k].func(values[i], compare[j]) ? "true" : "false"); - } + functions[k].func(values[i], compare[j]) ? "True" : "False"); + @} printf("\n"); - } - } + @} + @} return 0; -} +@} @c endfile @end ignore |