Quantcast
Channel: Nested cos() calculation in Oracle 10 - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Lukasz Szozda for Nested cos() calculation in Oracle 10

$
0
0

Using WITH FUNCTION(Oracle 12c):

WITH FUNCTION coscos(n INT) RETURN NUMBER ISBEGIN   IF n > 1      THEN RETURN cos(coscos(n-1));     ELSE RETURN cos(0);      END IF;END;SELECT n, coscos(n)FROM t;

db<>fiddle demo

Output:

+-----+-------------------------------------------+| N   |                 COSCOS(N)                 |+-----+-------------------------------------------+|  1  |                                         1 ||  2  | .5403023058681397174009366074429766037354 ||  5  |  .793480358742565591826054230990284002387 || 10  | .7314040424225098582924268769524825209688 |+-----+-------------------------------------------+

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>