<?xml version="1.0"?>
<paste-with-annotations>
  <paste>
    <number>
      <integer>51815</integer>
    </number>
    <user>
      <string>faxathisia</string>
    </user>
    <title>
      <string>SQL Square root</string>
    </title>
    <contents>
      <string>-- Square root procedure
-- Purpose: Y is automatically set to the (approximate)
--          sqrt of X upon insertion
-- Example Usage: INSERT INTO Sqrt VALUES(3.0,NULL);

CREATE TABLE Sqrt (X real, Y real DEFAULT 0.0);
CREATE TRIGGER newton_iterate AFTER INSERT ON Sqrt
 BEGIN
  UPDATE Sqrt SET Y = X;
  UPDATE Sqrt SET Y = (Y+X/Y)/2; UPDATE Sqrt SET Y = (Y+X/Y)/2;
  UPDATE Sqrt SET Y = (Y+X/Y)/2; UPDATE Sqrt SET Y = (Y+X/Y)/2;
  UPDATE Sqrt SET Y = (Y+X/Y)/2; UPDATE Sqrt SET Y = (Y+X/Y)/2;
  UPDATE Sqrt SET Y = (Y+X/Y)/2; UPDATE Sqrt SET Y = (Y+X/Y)/2;
  UPDATE Sqrt SET Y = (Y+X/Y)/2; UPDATE Sqrt SET Y = (Y+X/Y)/2;
  UPDATE Sqrt SET Y = (Y+X/Y)/2; UPDATE Sqrt SET Y = (Y+X/Y)/2;
 END;

</string>
    </contents>
    <universal-time>
      <integer>3405637750</integer>
    </universal-time>
    <channel>
      <string>#lispcafe</string>
    </channel>
    <colorization-mode>
      <string></string>
    </colorization-mode>
    <maybe-spam>
      <null/>
    </maybe-spam>
    <is-unicode>
      <null/>
    </is-unicode>
  </paste>
</paste-with-annotations>