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

📄 subtract.dectest

📁 eda is an estimation of distributions algorithm
💻 DECTEST
📖 第 1 页 / 共 3 页
字号:
subx622 subtract 0.000001      '123456789' -> '-123456789' Inexact Rounded
subx623 subtract 0.1           '123456789' -> '-123456789' Inexact Rounded
subx624 subtract 0.4           '123456789' -> '-123456789' Inexact Rounded
subx625 subtract 0.49          '123456789' -> '-123456789' Inexact Rounded
subx626 subtract 0.499999      '123456789' -> '-123456789' Inexact Rounded
subx627 subtract 0.499999999   '123456789' -> '-123456789' Inexact Rounded
subx628 subtract 0.5           '123456789' -> '-123456788' Inexact Rounded
subx629 subtract 0.500000001   '123456789' -> '-123456788' Inexact Rounded
subx630 subtract 0.500001      '123456789' -> '-123456788' Inexact Rounded
subx631 subtract 0.51          '123456789' -> '-123456788' Inexact Rounded
subx632 subtract 0.6           '123456789' -> '-123456788' Inexact Rounded
subx633 subtract 0.9           '123456789' -> '-123456788' Inexact Rounded
subx634 subtract 0.99999       '123456789' -> '-123456788' Inexact Rounded
subx635 subtract 0.999999999   '123456789' -> '-123456788' Inexact Rounded
subx636 subtract 1             '123456789' -> '-123456788'
subx637 subtract 1.00000001    '123456789' -> '-123456788' Inexact Rounded
subx638 subtract 1.00001       '123456789' -> '-123456788' Inexact Rounded
subx639 subtract 1.1           '123456789' -> '-123456788' Inexact Rounded
-- critical few with even bottom digit...
subx640 subtract 0.499999999   '123456788' -> '-123456788' Inexact Rounded
subx641 subtract 0.5           '123456788' -> '-123456788' Inexact Rounded
subx642 subtract 0.500000001   '123456788' -> '-123456787' Inexact Rounded

rounding: down
subx650 subtract 0             '123456789' -> '-123456789'
subx651 subtract 0.000000001   '123456789' -> '-123456788' Inexact Rounded
subx652 subtract 0.000001      '123456789' -> '-123456788' Inexact Rounded
subx653 subtract 0.1           '123456789' -> '-123456788' Inexact Rounded
subx654 subtract 0.4           '123456789' -> '-123456788' Inexact Rounded
subx655 subtract 0.49          '123456789' -> '-123456788' Inexact Rounded
subx656 subtract 0.499999      '123456789' -> '-123456788' Inexact Rounded
subx657 subtract 0.499999999   '123456789' -> '-123456788' Inexact Rounded
subx658 subtract 0.5           '123456789' -> '-123456788' Inexact Rounded
subx659 subtract 0.500000001   '123456789' -> '-123456788' Inexact Rounded
subx660 subtract 0.500001      '123456789' -> '-123456788' Inexact Rounded
subx661 subtract 0.51          '123456789' -> '-123456788' Inexact Rounded
subx662 subtract 0.6           '123456789' -> '-123456788' Inexact Rounded
subx663 subtract 0.9           '123456789' -> '-123456788' Inexact Rounded
subx664 subtract 0.99999       '123456789' -> '-123456788' Inexact Rounded
subx665 subtract 0.999999999   '123456789' -> '-123456788' Inexact Rounded
subx666 subtract 1             '123456789' -> '-123456788'
subx667 subtract 1.00000001    '123456789' -> '-123456787' Inexact Rounded
subx668 subtract 1.00001       '123456789' -> '-123456787' Inexact Rounded
subx669 subtract 1.1           '123456789' -> '-123456787' Inexact Rounded


-- lots of leading zeros in intermediate result, and showing effects of
-- input rounding would have affected the following
precision: 9
rounding: half_up
subx670 subtract '123456789' '123456788.1' -> 0.9
subx671 subtract '123456789' '123456788.9' -> 0.1
subx672 subtract '123456789' '123456789.1' -> -0.1
subx673 subtract '123456789' '123456789.5' -> -0.5
subx674 subtract '123456789' '123456789.9' -> -0.9

rounding: half_even
subx680 subtract '123456789' '123456788.1' -> 0.9
subx681 subtract '123456789' '123456788.9' -> 0.1
subx682 subtract '123456789' '123456789.1' -> -0.1
subx683 subtract '123456789' '123456789.5' -> -0.5
subx684 subtract '123456789' '123456789.9' -> -0.9

subx685 subtract '123456788' '123456787.1' -> 0.9
subx686 subtract '123456788' '123456787.9' -> 0.1
subx687 subtract '123456788' '123456788.1' -> -0.1
subx688 subtract '123456788' '123456788.5' -> -0.5
subx689 subtract '123456788' '123456788.9' -> -0.9

rounding: down
subx690 subtract '123456789' '123456788.1' -> 0.9
subx691 subtract '123456789' '123456788.9' -> 0.1
subx692 subtract '123456789' '123456789.1' -> -0.1
subx693 subtract '123456789' '123456789.5' -> -0.5
subx694 subtract '123456789' '123456789.9' -> -0.9

-- input preparation tests
rounding: half_up
precision: 3

subx700 subtract '12345678900000'  -9999999999999 ->  '2.23E+13' Inexact Rounded
subx701 subtract  '9999999999999' -12345678900000 ->  '2.23E+13' Inexact Rounded
subx702 subtract '12E+3'  '-3456' ->  '1.55E+4' Inexact Rounded
subx703 subtract '12E+3'  '-3446' ->  '1.54E+4' Inexact Rounded
subx704 subtract '12E+3'  '-3454' ->  '1.55E+4' Inexact Rounded
subx705 subtract '12E+3'  '-3444' ->  '1.54E+4' Inexact Rounded

subx706 subtract '3456'  '-12E+3' ->  '1.55E+4' Inexact Rounded
subx707 subtract '3446'  '-12E+3' ->  '1.54E+4' Inexact Rounded
subx708 subtract '3454'  '-12E+3' ->  '1.55E+4' Inexact Rounded
subx709 subtract '3444'  '-12E+3' ->  '1.54E+4' Inexact Rounded

-- overflow and underflow tests [subnormals now possible]
maxexponent: 999999999
precision: 9
rounding: down
subx710 subtract 1E+999999999    -9E+999999999   -> 9.99999999E+999999999 Overflow Inexact Rounded
subx711 subtract 9E+999999999    -1E+999999999   -> 9.99999999E+999999999 Overflow Inexact Rounded
rounding: half_up
subx712 subtract 1E+999999999    -9E+999999999   -> Infinity Overflow Inexact Rounded
subx713 subtract 9E+999999999    -1E+999999999   -> Infinity Overflow Inexact Rounded
subx714 subtract -1.1E-999999999 -1E-999999999   -> -1E-1000000000 Subnormal
subx715 subtract 1E-999999999    +1.1e-999999999 -> -1E-1000000000 Subnormal
subx716 subtract -1E+999999999   +9E+999999999   -> -Infinity Overflow Inexact Rounded
subx717 subtract -9E+999999999   +1E+999999999   -> -Infinity Overflow Inexact Rounded
subx718 subtract +1.1E-999999999 +1E-999999999   -> 1E-1000000000 Subnormal
subx719 subtract -1E-999999999   -1.1e-999999999 -> 1E-1000000000 Subnormal

precision: 3
subx720 subtract 1  9.999E+999999999   -> -Infinity Inexact Overflow Rounded
subx721 subtract 1 -9.999E+999999999   ->  Infinity Inexact Overflow Rounded
subx722 subtract    9.999E+999999999 1 ->  Infinity Inexact Overflow Rounded
subx723 subtract   -9.999E+999999999 1 -> -Infinity Inexact Overflow Rounded
subx724 subtract 1  9.999E+999999999   -> -Infinity Inexact Overflow Rounded
subx725 subtract 1 -9.999E+999999999   ->  Infinity Inexact Overflow Rounded
subx726 subtract    9.999E+999999999 1 ->  Infinity Inexact Overflow Rounded
subx727 subtract   -9.999E+999999999 1 -> -Infinity Inexact Overflow Rounded

-- [more below]

-- long operand checks
maxexponent: 999
precision: 9
sub731 subtract 12345678000 0 ->  1.23456780E+10 Rounded
sub732 subtract 0 12345678000 -> -1.23456780E+10 Rounded
sub733 subtract 1234567800  0 ->  1.23456780E+9 Rounded
sub734 subtract 0 1234567800  -> -1.23456780E+9 Rounded
sub735 subtract 1234567890  0 ->  1.23456789E+9 Rounded
sub736 subtract 0 1234567890  -> -1.23456789E+9 Rounded
sub737 subtract 1234567891  0 ->  1.23456789E+9 Inexact Rounded
sub738 subtract 0 1234567891  -> -1.23456789E+9 Inexact Rounded
sub739 subtract 12345678901 0 ->  1.23456789E+10 Inexact Rounded
sub740 subtract 0 12345678901 -> -1.23456789E+10 Inexact Rounded
sub741 subtract 1234567896  0 ->  1.23456790E+9 Inexact Rounded
sub742 subtract 0 1234567896  -> -1.23456790E+9 Inexact Rounded

precision: 15
sub751 subtract 12345678000 0 ->  12345678000
sub752 subtract 0 12345678000 -> -12345678000
sub753 subtract 1234567800  0 ->  1234567800
sub754 subtract 0 1234567800  -> -1234567800
sub755 subtract 1234567890  0 ->  1234567890
sub756 subtract 0 1234567890  -> -1234567890
sub757 subtract 1234567891  0 ->  1234567891
sub758 subtract 0 1234567891  -> -1234567891
sub759 subtract 12345678901 0 ->  12345678901
sub760 subtract 0 12345678901 -> -12345678901
sub761 subtract 1234567896  0 ->  1234567896
sub762 subtract 0 1234567896  -> -1234567896

-- Specials
subx780 subtract -Inf   Inf   -> -Infinity
subx781 subtract -Inf   1000  -> -Infinity
subx782 subtract -Inf   1     -> -Infinity
subx783 subtract -Inf  -0     -> -Infinity
subx784 subtract -Inf  -1     -> -Infinity
subx785 subtract -Inf  -1000  -> -Infinity
subx787 subtract -1000  Inf   -> -Infinity
subx788 subtract -Inf   Inf   -> -Infinity
subx789 subtract -1     Inf   -> -Infinity
subx790 subtract  0     Inf   -> -Infinity
subx791 subtract  1     Inf   -> -Infinity
subx792 subtract  1000  Inf   -> -Infinity

subx800 subtract  Inf   Inf   ->  NaN  Invalid_operation
subx801 subtract  Inf   1000  ->  Infinity
subx802 subtract  Inf   1     ->  Infinity
subx803 subtract  Inf   0     ->  Infinity
subx804 subtract  Inf  -0     ->  Infinity
subx805 subtract  Inf  -1     ->  Infinity
subx806 subtract  Inf  -1000  ->  Infinity
subx807 subtract  Inf  -Inf   ->  Infinity
subx808 subtract -1000 -Inf   ->  Infinity
subx809 subtract -Inf  -Inf   ->  NaN  Invalid_operation
subx810 subtract -1    -Inf   ->  Infinity
subx811 subtract -0    -Inf   ->  Infinity
subx812 subtract  0    -Inf   ->  Infinity
subx813 subtract  1    -Inf   ->  Infinity
subx814 subtract  1000 -Inf   ->  Infinity
subx815 subtract  Inf  -Inf   ->  Infinity

subx821 subtract  NaN   Inf   ->  NaN
subx822 subtract  NaN   1000  ->  NaN
subx823 subtract  NaN   1     ->  NaN
subx824 subtract  NaN   0     ->  NaN
subx825 subtract  NaN  -0     ->  NaN
subx826 subtract  NaN  -1     ->  NaN
subx827 subtract  NaN  -1000  ->  NaN
subx828 subtract  NaN  -Inf   ->  NaN
subx829 subtract  NaN   NaN   ->  NaN
subx830 subtract -Inf   NaN   ->  NaN
subx831 subtract -1000  NaN   ->  NaN
subx832 subtract -1     NaN   ->  NaN
subx833 subtract -0     NaN   ->  NaN
subx834 subtract  0     NaN   ->  NaN
subx835 subtract  1     NaN   ->  NaN
subx836 subtract  1000  NaN   ->  NaN
subx837 subtract  Inf   NaN   ->  NaN

subx841 subtract  sNaN  Inf   ->  NaN  Invalid_operation
subx842 subtract  sNaN  1000  ->  NaN  Invalid_operation
subx843 subtract  sNaN  1     ->  NaN  Invalid_operation
subx844 subtract  sNaN  0     ->  NaN  Invalid_operation
subx845 subtract  sNaN -0     ->  NaN  Invalid_operation
subx846 subtract  sNaN -1     ->  NaN  Invalid_operation
subx847 subtract  sNaN -1000  ->  NaN  Invalid_operation
subx848 subtract  sNaN  NaN   ->  NaN  Invalid_operation
subx849 subtract  sNaN sNaN   ->  NaN  Invalid_operation
subx850 subtract  NaN  sNaN   ->  NaN  Invalid_operation
subx851 subtract -Inf  sNaN   ->  NaN  Invalid_operation
subx852 subtract -1000 sNaN   ->  NaN  Invalid_operation
subx853 subtract -1    sNaN   ->  NaN  Invalid_operation
subx854 subtract -0    sNaN   ->  NaN  Invalid_operation
subx855 subtract  0    sNaN   ->  NaN  Invalid_operation
subx856 subtract  1    sNaN   ->  NaN  Invalid_operation
subx857 subtract  1000 sNaN   ->  NaN  Invalid_operation
subx858 subtract  Inf  sNaN   ->  NaN  Invalid_operation
subx859 subtract  NaN  sNaN   ->  NaN  Invalid_operation

-- subnormals and underflows
precision: 3
maxexponent: 999
subx1010 subtract  0  1.00E-999       ->  -1.00E-999
subx1011 subtract  0  0.1E-999        ->  -1E-1000   Subnormal
subx1012 subtract  0  0.10E-999       ->  -1.0E-1000 Subnormal
subx1013 subtract  0  0.100E-999      ->  -1.0E-1000 Subnormal Rounded
subx1014 subtract  0  0.01E-999       ->  -1E-1001   Subnormal
-- next is rounded to Emin
subx1015 subtract  0  0.999E-999      ->  -1.00E-999 Inexact Rounded Subnormal Underflow
subx1016 subtract  0  0.099E-999      ->  -1.0E-1000 Inexact Rounded Subnormal Underflow
subx1017 subtract  0  0.009E-999      ->  -1E-1001   Inexact Rounded Subnormal Underflow
subx1018 subtract  0  0.001E-999      ->  -0E-1001   Inexact Rounded Subnormal Underflow
subx1019 subtract  0  0.0009E-999     ->  -0E-1001   Inexact Rounded Subnormal Underflow
subx1020 subtract  0  0.0001E-999     ->  -0E-1001   Inexact Rounded Subnormal Underflow

subx1030 subtract  0 -1.00E-999       ->   1.00E-999
subx1031 subtract  0 -0.1E-999        ->   1E-1000   Subnormal
subx1032 subtract  0 -0.10E-999       ->   1.0E-1000 Subnormal
subx1033 subtract  0 -0.100E-999      ->   1.0E-1000 Subnormal Rounded
subx1034 subtract  0 -0.01E-999       ->   1E-1001   Subnormal
-- next is rounded to Emin
subx1035 subtract  0 -0.999E-999      ->   1.00E-999 Inexact Rounded Subnormal Underflow
subx1036 subtract  0 -0.099E-999      ->   1.0E-1000 Inexact Rounded Subnormal Underflow
subx1037 subtract  0 -0.009E-999      ->   1E-1001   Inexact Rounded Subnormal Underflow
subx1038 subtract  0 -0.001E-999      ->   0E-1001   Inexact Rounded Subnormal Underflow
subx1039 subtract  0 -0.0009E-999     ->   0E-1001   Inexact Rounded Subnormal Underflow
subx1040 subtract  0 -0.0001E-999     ->   0E-1001   Inexact Rounded Subnormal Underflow

-- some non-zero subnormal subtracts
-- subx1056 is a tricky case
rounding: half_up
subx1050 subtract  1.00E-999   0.1E-999  ->   9.0E-1000  Subnormal
subx1051 subtract  0.1E-999    0.1E-999  ->   0E-1000
subx1052 subtract  0.10E-999   0.1E-999  ->   0E-1001
subx1053 subtract  0.100E-999  0.1E-999  ->   0E-1001
subx1054 subtract  0.01E-999   0.1E-999  ->   -9E-1001   Subnormal
subx1055 subtract  0.999E-999  0.1E-999  ->   9.0E-1000  Inexact Rounded Subnormal Underflow
subx1056 subtract  0.099E-999  0.1E-999  ->   -0E-1001   Inexact Rounded Subnormal Underflow
subx1057 subtract  0.009E-999  0.1E-999  ->   -9E-1001   Inexact Rounded Subnormal Underflow
subx1058 subtract  0.001E-999  0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow
subx1059 subtract  0.0009E-999 0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow
subx1060 subtract  0.0001E-999 0.1E-999  ->   -1.0E-1000 Inexact Rounded Subnormal Underflow


-- Null tests
subx9990 subtract 10  # -> NaN Invalid_operation
subx9991 subtract  # 10 -> NaN Invalid_operation

⌨️ 快捷键说明

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