ネタ

任意の桁数にて、小数位の有効桁数を算出する
FUNCTION DEC_FIGURE( N NUMBER ) RETURN NUMBER IS
FIGURE NUMBER;
BEGIN
--
FIGURE := N MOD 1;
IF FIGURE = 0 THEN
RETURN(0);
END IF;
--
FOR I IN 0..38 LOOP
IF ((FIGURE * POWER(10,I)) MOD 1) = 0 THEN
RETURN(I);
END IF;
END LOOP;
--
RETURN(999);
EXCEPTION
WHEN OTHERS THEN
RETURN(0);
END DEC_FIGURE;
[PR]
by zingbay | 2005-08-01 17:17 | 日々雑記
<< 本日も順風なり 覚書 >>