Created
June 3, 2020 06:46
-
-
Save seifip/a172fa352352eab740913c63c443c2f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION test_float() | |
RETURNS float AS $$ | |
DECLARE | |
price float = 0.0; | |
BEGIN | |
WHILE price < 10.0 LOOP | |
price = price + 0.1; | |
END LOOP; | |
RETURN price; | |
END; | |
$$ LANGUAGE plpgsql; | |
SELECT test_float(); | |
-- test_float | |
-- --------------------- | |
-- 10.09999999999998 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment