I realize that obscure.ops isn't a big deal, but why not make
it work?  Thus this patch.  This patch eliminates the versions
of the ops that accept integers, under the assumption that trig
on integers is extraordinarily silly.

Index: obscure.ops
===================================================================
RCS file: /home/perlcvs/parrot/obscure.ops,v
retrieving revision 1.6
diff -u -2 -p -r1.6 obscure.ops
--- obscure.ops 3 Jan 2002 19:41:46 -0000       1.6
+++ obscure.ops 21 Apr 2002 02:49:21 -0000
@@ -37,6 +37,4 @@ Reference:
 ########################################
 
-=item B<covers>(n, i)
-
 =item B<covers>(n, n)
 
@@ -45,6 +43,6 @@ Set $1 to the coversine (in radians) of 
 =cut
 
-inline op covers(n, i|n) {
-  $1 = 1.0 - sin((FLOATVAL)$2);
+inline op covers(out NUM, in NUM) {
+  $1 = 1.0 - sin($2);
   goto NEXT();
 }
@@ -53,6 +51,4 @@ inline op covers(n, i|n) {
 ########################################
 
-=item B<exsec>(n, i)
-
 =item B<exsec>(n, n)
 
@@ -62,6 +58,6 @@ Set $1 to the exsecant of $2 (given in r
 
 
-inline op exsec(n, i|n) {
-  $1 = (((FLOATVAL)1.0) / cos((FLOATVAL)$2)) - (FLOATVAL)1.0;
+inline op exsec(out NUM, in NUM) {
+  $1 = (1.0 / cos($2)) - 1.0;
   goto NEXT();
 }
@@ -70,6 +66,4 @@ inline op exsec(n, i|n) {
 ########################################
 
-=item B<hav>(n, i)
-
 =item B<hav>(n, n)
 
@@ -78,6 +72,6 @@ Set $1 to the haversine (in radians) of 
 =cut
 
-inline op hav(n, i|n) {
-  $1 = 0.5 * (1.0 - cos((FLOATVAL)$2));
+inline op hav(out NUM, in NUM) {
+  $1 = 0.5 * (1.0 - cos($2));
   goto NEXT();
 }
@@ -86,6 +80,4 @@ inline op hav(n, i|n) {
 ########################################
 
-=item B<vers>(n, i)
-
 =item B<vers>(n, n)
 
@@ -94,6 +86,6 @@ Set $1 to the versine (in radians) of $2
 =cut
 
-inline op vers(n, i|n) {
-  $1 = 1.0 - cos((FLOATVAL)$2);
+inline op vers(out NUM, in NUM) {
+  $1 = 1.0 - cos($2);
   goto NEXT();
 }
-- 
Chip Salzenberg         - a.k.a.  -        <[EMAIL PROTECTED]>
         "It furthers one to have somewhere to go."

Reply via email to