interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / test / atof2.test

35 lines · 871 bytes Raw Blame History
1# 2026-02-20
2#
3# The author disclaims copyright to this source code. In place of
4# a legal notice, here is a blessing:
5#
6# May you do good and not evil.
7# May you find forgiveness for yourself and forgive others.
8# May you share freely, never taking more than you give.
9#
10#***********************************************************************
11#
12# Tests of the sqlite3AtoF() function.
13#
14
15set testdir [file dirname $argv0]
16source $testdir/tester.tcl
17
18# Rounding cases:
19#
20do_execsql_test atof2-1.0 {
21 SELECT format('%g',192.496475);
22} 192.496
23do_execsql_test atof2-1.1 {
24 SELECT format('%g',192.496501);
25} 192.497
26
27load_static_extension db ieee754
28do_execsql_test atof2-2.1 {
29 SELECT format('%!.30f',ieee754_inc(100.0,-1));
30} 99.9999999999999858
31do_execsql_test atof2-2.2 {
32 SELECT format('%!.30f',ieee754_inc(100.0,-2));
33} 99.9999999999999716
34
35finish_test