You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems there is a bug where on x86 (tested on musl/alpine 3.19) I'm getting incorrect values for the sin() function.
Given a sample program which just runs select sin(8.9):
Results on x86 (incorrect):
-2.1634211956023357
Result on x86_64 (correct):
0.5010208564578846
Running within the sqlite3 CLI the same select sin(8.9) on x86 returns the correct 0.5010208564578846; so I believe this is a bug in go-sqlite3 or a binding. I'm not sure if this just effects alpine/musl x86 or additionally glibc x86.
Sample test program:
// Run via go run -tags=sqlite_math_functions foo.gopackage main
import (
"database/sql""fmt""log"
_ "github.com/mattn/go-sqlite3"
)
funcmain() {
db, err:=sql.Open("sqlite3", ":memory:")
iferr!=nil {
log.Fatal(err)
}
deferdb.Close()
rows, err:=db.Query("select sin(8.9)")
iferr!=nil {
log.Fatal(err)
}
deferrows.Close()
varresultfloat64forrows.Next() {
iferr:=rows.Scan(&result); err!=nil {
log.Fatal(err)
}
}
fmt.Println("Result:", result)
}
The text was updated successfully, but these errors were encountered:
It seems there is a bug where on x86 (tested on musl/alpine 3.19) I'm getting incorrect values for the
sin()
function.Given a sample program which just runs
select sin(8.9)
:Results on x86 (incorrect):
Result on x86_64 (correct):
Running within the
sqlite3
CLI the sameselect sin(8.9)
on x86 returns the correct0.5010208564578846
; so I believe this is a bug ingo-sqlite3
or a binding. I'm not sure if this just effects alpine/musl x86 or additionally glibc x86.Sample test program:
The text was updated successfully, but these errors were encountered: