⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 expr-old.test

📁 linux系统下的音频通信
💻 TEST
📖 第 1 页 / 共 3 页
字号:
} {1 {syntax error in expression "2 + (3 + 4"}}test expr-old-31.3 {multiple arguments to expr command} {    list [catch {expr 2 + 3 +} msg] $msg} {1 {syntax error in expression "2 + 3 +"}}test expr-old-31.4 {multiple arguments to expr command} {    list [catch {expr 2 + 3 )} msg] $msg} {1 {syntax error in expression "2 + 3 )"}}# Math functionstest expr-old-32.1 {math functions in expressions} {    format %.6g [expr acos(0.5)]} {1.0472}test expr-old-32.2 {math functions in expressions} {    format %.6g [expr asin(0.5)]} {0.523599}test expr-old-32.3 {math functions in expressions} {    format %.6g [expr atan(1.0)]} {0.785398}test expr-old-32.4 {math functions in expressions} {    format %.6g [expr atan2(2.0, 2.0)]} {0.785398}test expr-old-32.5 {math functions in expressions} {    format %.6g [expr ceil(1.999)]} {2}test expr-old-32.6 {math functions in expressions} {    format %.6g [expr cos(.1)]} {0.995004}test expr-old-32.7 {math functions in expressions} {    format %.6g [expr cosh(.1)]} {1.005}test expr-old-32.8 {math functions in expressions} {    format %.6g [expr exp(1.0)]} {2.71828}test expr-old-32.9 {math functions in expressions} {    format %.6g [expr floor(2.000)]} {2}test expr-old-32.10 {math functions in expressions} {    format %.6g [expr floor(2.001)]} {2}test expr-old-32.11 {math functions in expressions} {    format %.6g [expr fmod(7.3, 3.2)]} {0.9}test expr-old-32.12 {math functions in expressions} {    format %.6g [expr hypot(3.0, 4.0)]} {5}test expr-old-32.13 {math functions in expressions} {    format %.6g [expr log(2.8)]} {1.02962}test expr-old-32.14 {math functions in expressions} {    format %.6g [expr log10(2.8)]} {0.447158}test expr-old-32.15 {math functions in expressions} {    format %.6g [expr pow(2.1, 3.1)]} {9.97424}test expr-old-32.16 {math functions in expressions} {    format %.6g [expr sin(.1)]} {0.0998334}test expr-old-32.17 {math functions in expressions} {    format %.6g [expr sinh(.1)]} {0.100167}test expr-old-32.18 {math functions in expressions} {    format %.6g [expr sqrt(2.0)]} {1.41421}test expr-old-32.19 {math functions in expressions} {    format %.6g [expr tan(0.8)]} {1.02964}test expr-old-32.20 {math functions in expressions} {    format %.6g [expr tanh(0.8)]} {0.664037}test expr-old-32.21 {math functions in expressions} {    format %.6g [expr abs(-1.8)]} {1.8}test expr-old-32.22 {math functions in expressions} {    expr abs(10.0)} {10.0}test expr-old-32.23 {math functions in expressions} {    format %.6g [expr abs(-4)]} {4}test expr-old-32.24 {math functions in expressions} {    format %.6g [expr abs(66)]} {66}# The following test is different for 32-bit versus 64-bit architectures.if {0x80000000 > 0} {    test expr-old-32.25 {math functions in expressions} {nonPortable} {	list [catch {expr abs(0x8000000000000000)} msg] $msg    } {1 {integer value too large to represent}}} else {    test expr-old-32.25 {math functions in expressions} {nonPortable} {	list [catch {expr abs(0x80000000)} msg] $msg    } {1 {integer value too large to represent}}}test expr-old-32.26 {math functions in expressions} {    expr double(1)} {1.0}test expr-old-32.27 {math functions in expressions} {    expr double(1.1)} {1.1}test expr-old-32.28 {math functions in expressions} {    expr int(1)} {1}test expr-old-32.29 {math functions in expressions} {    expr int(1.4)} {1}test expr-old-32.30 {math functions in expressions} {    expr int(1.6)} {1}test expr-old-32.31 {math functions in expressions} {    expr int(-1.4)} {-1}test expr-old-32.32 {math functions in expressions} {    expr int(-1.6)} {-1}test expr-old-32.33 {math functions in expressions} {    list [catch {expr int(1e60)} msg] $msg} {1 {integer value too large to represent}}test expr-old-32.34 {math functions in expressions} {    list [catch {expr int(-1e60)} msg] $msg} {1 {integer value too large to represent}}test expr-old-32.35 {math functions in expressions} {    expr round(1.49)} {1}test expr-old-32.36 {math functions in expressions} {    expr round(1.51)} {2}test expr-old-32.37 {math functions in expressions} {    expr round(-1.49)} {-1}test expr-old-32.38 {math functions in expressions} {    expr round(-1.51)} {-2}test expr-old-32.39 {math functions in expressions} {    list [catch {expr round(1e60)} msg] $msg} {1 {integer value too large to represent}}test expr-old-32.40 {math functions in expressions} {    list [catch {expr round(-1e60)} msg] $msg} {1 {integer value too large to represent}}test expr-old-32.41 {math functions in expressions} {    list [catch {expr pow(1.0 + 3.0 - 2, .8 * 5)} msg] $msg} {0 16.0}test expr-old-32.42 {math functions in expressions} {    list [catch {expr hypot(5*.8,3)} msg] $msg} {0 5.0}if $gotT1 {    test expr-old-32.43 {math functions in expressions} {	expr 2*T1()    } 246    test expr-old-32.44 {math functions in expressions} {	expr T2()*3    } 1035}test expr-old-32.45 {math functions in expressions} {    expr (0 <= rand()) && (rand() < 1)} {1}test expr-old-32.46 {math functions in expressions} {    list [catch {expr rand(24)} msg] $msg} {1 {syntax error in expression "rand(24)"}}test expr-old-32.47 {math functions in expressions} {    list [catch {expr srand()} msg] $msg} {1 {syntax error in expression "srand()"}}test expr-old-32.48 {math functions in expressions} {    list [catch {expr srand(3.79)} msg] $msg} {1 {can't use floating-point value as argument to srand}}test expr-old-32.49 {math functions in expressions} {    list [catch {expr srand("")} msg] $msg} {1 {can't use non-numeric string as argument to srand}}test expr-old-32.50 {math functions in expressions} {    set result [expr round(srand(12345) * 1000)]    for {set i 0} {$i < 10} {incr i} {	lappend result [expr round(rand() * 1000)]    }    set result} {97 834 948 36 12 51 766 585 914 784 333}test expr-old-32.51 {math functions in expressions} {    list [catch {expr {srand([lindex "6ty" 0])}} msg] $msg} {1 {can't use non-numeric string as argument to srand}}test expr-old-33.1 {conversions and fancy args to math functions} {    expr hypot ( 3 , 4 )} 5.0test expr-old-33.2 {conversions and fancy args to math functions} {    expr hypot ( (2.0+1.0) , 4 )} 5.0test expr-old-33.3 {conversions and fancy args to math functions} {    expr hypot ( 3 , (3.0 + 1.0) )} 5.0test expr-old-33.4 {conversions and fancy args to math functions} {    format %.6g [expr cos(acos(0.1))]} 0.1test expr-old-34.1 {errors in math functions} {    list [catch {expr func_2(1.0)} msg] $msg} {1 {unknown math function "func_2"}}test expr-old-34.2 {errors in math functions} {    list [catch {expr func|(1.0)} msg] $msg} {1 {syntax error in expression "func|(1.0)"}}test expr-old-34.3 {errors in math functions} {    list [catch {expr {hypot("a b", 2.0)}} msg] $msg} {1 {argument to math function didn't have numeric value}}test expr-old-34.4 {errors in math functions} {    list [catch {expr hypot(1.0 2.0)} msg] $msg} {1 {syntax error in expression "hypot(1.0 2.0)"}}test expr-old-34.5 {errors in math functions} {    list [catch {expr hypot(1.0, 2.0} msg] $msg} {1 {syntax error in expression "hypot(1.0, 2.0"}}test expr-old-34.6 {errors in math functions} {    list [catch {expr hypot(1.0 ,} msg] $msg} {1 {syntax error in expression "hypot(1.0 ,"}}test expr-old-34.7 {errors in math functions} {    list [catch {expr hypot(1.0)} msg] $msg} {1 {too few arguments for math function}}test expr-old-34.8 {errors in math functions} {    list [catch {expr hypot(1.0, 2.0, 3.0)} msg] $msg} {1 {too many arguments for math function}}test expr-old-34.9 {errors in math functions} {    list [catch {expr acos(-2.0)} msg] $msg $errorCode} {1 {domain error: argument not in valid range} {ARITH DOMAIN {domain error: argument not in valid range}}}test expr-old-34.10 {errors in math functions} {nonPortable} {    list [catch {expr pow(-3, 1000001)} msg] $msg $errorCode} {1 {floating-point value too large to represent} {ARITH OVERFLOW {floating-point value too large to represent}}}test expr-old-34.11 {errors in math functions} {    list [catch {expr pow(3, 1000001)} msg] $msg $errorCode} {1 {floating-point value too large to represent} {ARITH OVERFLOW {floating-point value too large to represent}}}test expr-old-34.12 {errors in math functions} {    list [catch {expr -14.0*exp(100000)} msg] $msg $errorCode} {1 {floating-point value too large to represent} {ARITH OVERFLOW {floating-point value too large to represent}}}test expr-old-34.13 {errors in math functions} {    list [catch {expr int(1.0e30)} msg] $msg $errorCode} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}test expr-old-34.14 {errors in math functions} {    list [catch {expr int(-1.0e30)} msg] $msg $errorCode} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}test expr-old-34.15 {errors in math functions} {    list [catch {expr round(1.0e30)} msg] $msg $errorCode} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}test expr-old-34.16 {errors in math functions} {    list [catch {expr round(-1.0e30)} msg] $msg $errorCode} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}if $gotT1 {    test expr-old-34.17 {errors in math functions} {	list [catch {expr T1(4)} msg] $msg    } {1 {syntax error in expression "T1(4)"}}}test expr-old-36.1 {ExprLooksLikeInt procedure} {    list [catch {expr 0289} msg] $msg} {1 {syntax error in expression "0289"}}test expr-old-36.2 {ExprLooksLikeInt procedure} {    set x 0289    list [catch {expr {$x+1}} msg] $msg} {1 {can't use non-numeric string as operand of "+"}}test expr-old-36.3 {ExprLooksLikeInt procedure} {    list [catch {expr 0289.1} msg] $msg} {0 289.1}test expr-old-36.4 {ExprLooksLikeInt procedure} {    set x 0289.1    list [catch {expr {$x+1}} msg] $msg} {0 290.1}test expr-old-36.5 {ExprLooksLikeInt procedure} {    set x {  +22}    list [catch {expr {$x+1}} msg] $msg} {0 23}test expr-old-36.6 {ExprLooksLikeInt procedure} {    set x {	-22}    list [catch {expr {$x+1}} msg] $msg} {0 -21}test expr-old-36.7 {ExprLooksLikeInt procedure} {nonPortable unixOnly} {    list [catch {expr nan} msg] $msg} {1 {domain error: argument not in valid range}}test expr-old-36.8 {ExprLooksLikeInt procedure} {    list [catch {expr 78e1} msg] $msg} {0 780.0}test expr-old-36.9 {ExprLooksLikeInt procedure} {    list [catch {expr 24E1} msg] $msg} {0 240.0}test expr-old-36.10 {ExprLooksLikeInt procedure} {nonPortable unixOnly} {    list [catch {expr 78e} msg] $msg} {1 {syntax error in expression "78e"}}if {[info commands testexprlong] == {}} {    puts "This application hasn't been compiled with the \"testexprlong\""    puts "command, so I can't test Tcl_ExprLong etc."} else {test expr-old-37.1 {Check that Tcl_ExprLong doesn't modify interpreter result if no error} {    testexprlong} {This is a result: 5}}if {[info commands testexprstring] == {}} {    puts "This application hasn't been compiled with the \"testexprstring\""    puts "command, so I can't test Tcl_ExprString etc."} else {test expr-old-38.1 {Verify Tcl_ExprString's basic operation} {    list [testexprstring "1+4"] [testexprstring "2*3+4.2"] \        [catch {testexprstring "1+"} msg] $msg} {5 10.2 1 {syntax error in expression "1+"}}}# Special test for Pentium arithmetic bug of 1994:if {(4195835.0 - (4195835.0/3145727.0)*3145727.0) == 256.0} {    puts "Warning: this machine contains a defective Pentium processor"    puts "that performs arithmetic incorrectly.  I recommend that you"    puts "call Intel customer service immediately at 1-800-628-8686"    puts "to request a replacement processor."}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -