README.md

This commit is contained in:
Gwendal Roué committed 2015-11-19 14:31:56 +01:00
1 parent 999b98e1f0
commit f2a8d91b5d
1 file changed
+6 -1
+6 -1
View File
@@ -1113,10 +1113,15 @@ dbQueue.inDatabase { db in
return nil
}
guard double >= 0.0 else {
throw DatabaseError(message: "Invalid negative value")
throw DatabaseError(message: "Invalid negative value in function sqrt()")
}
return sqrt(double)
}
db.addFunction(fn)
// fatal error: SQLite error 1 with statement `SELECT sqrt(-1)`:
// Invalid negative value in function sqrt()
Double.fetchOne(db, "SELECT sqrt(-1)")
}
```