Changeset 3029
- Timestamp:
- Jan 18, 2005, 8:53:03 AM (22 years ago)
- Location:
- trunk/Ohana/src/opihi/lib.shell
- Files:
-
- 3 edited
-
convert_to_RPN.c (modified) (2 diffs)
-
isolate_elements.c (modified) (2 diffs)
-
stack_math.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.shell/convert_to_RPN.c
r2598 r3029 48 48 if (!strcmp (argv[i], "dacos")) { type = 7; goto gotit; } 49 49 if (!strcmp (argv[i], "datan")) { type = 7; goto gotit; } 50 51 if (!strcmp (argv[i], "lgamma")) { type = 7; goto gotit; } 52 50 53 if (!strcmp (argv[i], "rnd")) { type = 7; goto gotit; } 51 54 if (!strcmp (argv[i], "xramp")) { type = 7; goto gotit; } … … 60 63 /* binary operations */ 61 64 if (!strcmp (argv[i], "^")) { type = 6; goto gotit; } 65 if (!strcmp (argv[i], "@")) { type = 5; goto gotit; } 62 66 63 67 if (!strcmp (argv[i], "<")) { type = 5; goto gotit; } -
trunk/Ohana/src/opihi/lib.shell/isolate_elements.c
r2598 r3029 147 147 if (!strncmp (c, "-", 1)) return (TRUE); 148 148 if (!strncmp (c, "^", 1)) return (TRUE); 149 if (!strncmp (c, "@", 1)) return (TRUE); 149 150 if (!strncmp (c, "(", 1)) return (TRUE); 150 151 if (!strncmp (c, ")", 1)) return (TRUE); … … 152 153 if (!strncmp (c, "|", 1)) return (TRUE); 153 154 if (!strncmp (c, ">", 1)) return (TRUE); 155 if (!strncmp (c, "<", 1)) return (TRUE); 154 156 if (!strncmp (c, "<", 1)) return (TRUE); 155 157 if (!strncmp (c, "<<", 2)) return (TRUE); -
trunk/Ohana/src/opihi/lib.shell/stack_math.c
r2833 r3029 56 56 *out = pow (*M1, *M2); 57 57 break; 58 case '@': 59 for (i = 0; i < Nx; i++, out++, M1++, M2++) 60 *out = DEG_RAD*atan2 (*M1, *M2); 61 break; 58 62 case 'D': 59 63 for (i = 0; i < Nx; i++, out++, M1++, M2++) … … 168 172 *out = pow (*M1, *M2); 169 173 break; 174 case '@': 175 for (i = 0; i < Nx; i++, out++, M2++) 176 *out = DEG_RAD*atan2 (*M1, *M2); 177 break; 170 178 case 'D': 171 179 for (i = 0; i < Nx; i++, out++, M2++) … … 274 282 for (i = 0; i < Nx; i++, out++, M1++) 275 283 *out = pow (*M1, *M2); 284 break; 285 case '@': 286 for (i = 0; i < Nx; i++, out++, M1++) 287 *out = DEG_RAD*atan2 (*M1, *M2); 276 288 break; 277 289 case 'D': … … 399 411 } 400 412 break; 413 case '@': 414 for (i = 0; i < Ny; i++, M2++) { 415 for (j = 0; j < Nx; j++, out++, M1++) 416 *out = DEG_RAD*atan2 (*M1, *M2); 417 } 418 break; 401 419 case 'D': 402 420 for (i = 0; i < Ny; i++, M2++) { … … 554 572 for (j = 0; j < Nx; j++, out++, M1++, M2++) 555 573 *out = pow (*M1, *M2); 574 } 575 break; 576 case '@': 577 for (i = 0; i < Ny; i++) { 578 M1 = V1[0].ptr; 579 for (j = 0; j < Nx; j++, out++, M1++, M2++) 580 *out = DEG_RAD*atan2 (*M1, *M2); 556 581 } 557 582 break; … … 710 735 *out = pow (*M1, *M2); 711 736 break; 737 case '@': 738 for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 739 *out = DEG_RAD*atan2 (*M1, *M2); 740 break; 712 741 case 'D': 713 742 for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) … … 826 855 *out = pow (*M1, *M2); 827 856 break; 857 case '@': 858 for (i = 0; i < Nx*Ny; i++, out++, M1++) 859 *out = DEG_RAD*atan2 (*M1, *M2); 860 break; 828 861 case 'D': 829 862 for (i = 0; i < Nx*Ny; i++, out++, M1++) … … 932 965 for (i = 0; i < Nx*Ny; i++, out++, M2++) 933 966 *out = pow (*M1, *M2); 967 break; 968 case '@': 969 for (i = 0; i < Nx*Ny; i++, out++, M2++) 970 *out = DEG_RAD*atan2 (*M1, *M2); 934 971 break; 935 972 case 'D': … … 1024 1061 *out = pow (*M1, *M2); 1025 1062 break; 1063 case '@': 1064 *out = DEG_RAD*atan2 (*M1, *M2); 1065 break; 1026 1066 case 'D': 1027 1067 *out = MIN (*M1, *M2); … … 1114 1154 if (!strcmp (op, "sqrt")) { *out = sqrt (*M1); } 1115 1155 1116 if (!strcmp (op, "sinh")) { *out = sinh (*M1); } 1117 if (!strcmp (op, "cosh")) { *out = cosh (*M1); } 1118 if (!strcmp (op, "asinh")) { *out = asinh (*M1); } 1119 if (!strcmp (op, "acosh")) { *out = acosh (*M1); } 1156 if (!strcmp (op, "sinh")) { *out = sinh (*M1); } 1157 if (!strcmp (op, "cosh")) { *out = cosh (*M1); } 1158 if (!strcmp (op, "asinh")) { *out = asinh (*M1); } 1159 if (!strcmp (op, "acosh")) { *out = acosh (*M1); } 1160 if (!strcmp (op, "lgamma")) { *out = lgamma (*M1); } 1120 1161 1121 1162 if (!strcmp (op, "sin")) { *out = sin (*M1); } … … 1170 1211 if (!strcmp (op, "sqrt")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = sqrt(*M1); }} 1171 1212 1172 if (!strcmp (op, "sinh")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = sinh(*M1); }} 1173 if (!strcmp (op, "cosh")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = cosh(*M1); }} 1174 if (!strcmp (op, "asinh")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = asinh(*M1); }} 1175 if (!strcmp (op, "acosh")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = acosh(*M1); }} 1213 if (!strcmp (op, "sinh")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = sinh(*M1); }} 1214 if (!strcmp (op, "cosh")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = cosh(*M1); }} 1215 if (!strcmp (op, "asinh")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = asinh(*M1); }} 1216 if (!strcmp (op, "acosh")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = acosh(*M1); }} 1217 if (!strcmp (op, "lgamma")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = lgamma(*M1); }} 1176 1218 1177 1219 if (!strcmp (op, "sin")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = sin(*M1); }} … … 1235 1277 if (!strcmp (op, "sqrt")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = sqrt(*M1); }} 1236 1278 1237 if (!strcmp (op, "sinh")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = sinh(*M1); }} 1238 if (!strcmp (op, "cosh")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = cosh(*M1); }} 1239 if (!strcmp (op, "asinh")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = asinh(*M1); }} 1240 if (!strcmp (op, "acosh")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = acosh(*M1); }} 1279 if (!strcmp (op, "sinh")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = sinh(*M1); }} 1280 if (!strcmp (op, "cosh")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = cosh(*M1); }} 1281 if (!strcmp (op, "asinh")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = asinh(*M1); }} 1282 if (!strcmp (op, "acosh")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = acosh(*M1); }} 1283 if (!strcmp (op, "lgamma")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = lgamma(*M1); }} 1241 1284 1242 1285 if (!strcmp (op, "sin")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = sin(*M1); }}
Note:
See TracChangeset
for help on using the changeset viewer.
