CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
73 lines
2.0 KiB
Plaintext
73 lines
2.0 KiB
Plaintext
# 2015-11-06
|
|
#
|
|
# The author disclaims copyright to this source code. In place of
|
|
# a legal notice, here is a blessing:
|
|
#
|
|
# May you do good and not evil.
|
|
# May you find forgiveness for yourself and forgive others.
|
|
# May you share freely, never taking more than you give.
|
|
#
|
|
#***********************************************************************
|
|
#
|
|
# Tests of the iee754 extension
|
|
#
|
|
|
|
set testdir [file dirname $argv0]
|
|
source $testdir/tester.tcl
|
|
|
|
load_static_extension db ieee754
|
|
|
|
foreach {id float rep} {
|
|
1 1.0 1,0
|
|
2 2.0 2,0
|
|
3 0.5 1,-1
|
|
4 1.5 3,-1
|
|
5 0.0 0,-1075
|
|
6 4.9406564584124654e-324 1,-1074
|
|
7 2.2250738585072009e-308 4503599627370495,-1074
|
|
8 2.2250738585072014e-308 1,-1022
|
|
} {
|
|
do_test ieee754-100-$id-1 {
|
|
db eval "SELECT ieee754($float);"
|
|
} "ieee754($rep)"
|
|
do_test ieee754-100-$id-2 {
|
|
db eval "SELECT ieee754($rep)==$float;"
|
|
} {1}
|
|
if {$float!=0.0} {
|
|
do_test ieee754-100-$id-3 {
|
|
db eval "SELECT ieee754(-$float);"
|
|
} "ieee754(-$rep)"
|
|
do_test ieee754-100-$id-4 {
|
|
db eval "SELECT ieee754(-$rep)==-$float;"
|
|
} {1}
|
|
}
|
|
}
|
|
|
|
do_test ieee754-110 {
|
|
string tolower [
|
|
db eval {SELECT ieee754(1,1024), ieee754(4503599627370495,972);}
|
|
]
|
|
} {inf 1.79769313486232e+308}
|
|
do_test ieee754-111 {
|
|
string tolower [
|
|
db eval {SELECT ieee754(-1,1024), ieee754(-4503599627370495,972);}
|
|
]
|
|
} {-inf -1.79769313486232e+308}
|
|
do_execsql_test ieee754-112 {
|
|
SELECT ieee754(4503599627370495,973) is null;
|
|
} {1}
|
|
|
|
do_execsql_test ieee754-200 {
|
|
SELECT ieee754(0.0), hex(ieee754_to_blob(ieee754(0,-1075)));
|
|
} {ieee754(0,-1075) 0000000000000000}
|
|
|
|
# Special case. -0.0 is rendered as ieee754(-1,-3071).
|
|
#
|
|
do_execsql_test ieee754-201 {
|
|
SELECT ieee754(-0.0), hex(ieee754_to_blob(ieee754(-1,-3071)));
|
|
} {ieee754(-1,-3071) 8000000000000000}
|
|
|
|
|
|
|
|
finish_test
|