You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
111 lines
4.5 KiB
Plaintext
111 lines
4.5 KiB
Plaintext
9 years ago
|
------------------------------------------------------------------------
|
||
|
-- tointegral0.decTest -- round decimal to integral value --
|
||
|
-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
|
||
|
------------------------------------------------------------------------
|
||
|
-- Please see the document "General Decimal Arithmetic Testcases" --
|
||
|
-- at http://www2.hursley.ibm.com/decimal for the description of --
|
||
|
-- these testcases. --
|
||
|
-- --
|
||
|
-- These testcases are experimental ('beta' versions), and they --
|
||
|
-- may contain errors. They are offered on an as-is basis. In --
|
||
|
-- particular, achieving the same results as the tests here is not --
|
||
|
-- a guarantee that an implementation complies with any Standard --
|
||
|
-- or specification. The tests are not exhaustive. --
|
||
|
-- --
|
||
|
-- Please send comments, suggestions, and corrections to the author: --
|
||
|
-- Mike Cowlishaw, IBM Fellow --
|
||
|
-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
|
||
|
-- mfc@uk.ibm.com --
|
||
|
------------------------------------------------------------------------
|
||
|
version: 2.58
|
||
|
|
||
|
-- This set of tests tests the extended specification 'round-to-integral
|
||
|
-- value' operation (from IEEE 854, later modified in 754r).
|
||
|
-- All non-zero results are defined as being those from either copy or
|
||
|
-- quantize, so those are assumed to have been tested.
|
||
|
-- Note that 754r requires that Inexact not be set, and we similarly
|
||
|
-- assume Rounded is not set.
|
||
|
|
||
|
extended: 0
|
||
|
precision: 9
|
||
|
rounding: half_up
|
||
|
maxExponent: 999
|
||
|
minexponent: -999
|
||
|
|
||
|
int001 tointegral 0 -> 0
|
||
|
int002 tointegral 0.0 -> 0
|
||
|
int003 tointegral 0.1 -> 0
|
||
|
int004 tointegral 0.2 -> 0
|
||
|
int005 tointegral 0.3 -> 0
|
||
|
int006 tointegral 0.4 -> 0
|
||
|
int007 tointegral 0.5 -> 1
|
||
|
int008 tointegral 0.6 -> 1
|
||
|
int009 tointegral 0.7 -> 1
|
||
|
int010 tointegral 0.8 -> 1
|
||
|
int011 tointegral 0.9 -> 1
|
||
|
int012 tointegral 1 -> 1
|
||
|
int013 tointegral 1.0 -> 1
|
||
|
int014 tointegral 1.1 -> 1
|
||
|
int015 tointegral 1.2 -> 1
|
||
|
int016 tointegral 1.3 -> 1
|
||
|
int017 tointegral 1.4 -> 1
|
||
|
int018 tointegral 1.5 -> 2
|
||
|
int019 tointegral 1.6 -> 2
|
||
|
int020 tointegral 1.7 -> 2
|
||
|
int021 tointegral 1.8 -> 2
|
||
|
int022 tointegral 1.9 -> 2
|
||
|
-- negatives
|
||
|
int031 tointegral -0 -> 0
|
||
|
int032 tointegral -0.0 -> 0
|
||
|
int033 tointegral -0.1 -> 0
|
||
|
int034 tointegral -0.2 -> 0
|
||
|
int035 tointegral -0.3 -> 0
|
||
|
int036 tointegral -0.4 -> 0
|
||
|
int037 tointegral -0.5 -> -1
|
||
|
int038 tointegral -0.6 -> -1
|
||
|
int039 tointegral -0.7 -> -1
|
||
|
int040 tointegral -0.8 -> -1
|
||
|
int041 tointegral -0.9 -> -1
|
||
|
int042 tointegral -1 -> -1
|
||
|
int043 tointegral -1.0 -> -1
|
||
|
int044 tointegral -1.1 -> -1
|
||
|
int045 tointegral -1.2 -> -1
|
||
|
int046 tointegral -1.3 -> -1
|
||
|
int047 tointegral -1.4 -> -1
|
||
|
int048 tointegral -1.5 -> -2
|
||
|
int049 tointegral -1.6 -> -2
|
||
|
int050 tointegral -1.7 -> -2
|
||
|
int051 tointegral -1.8 -> -2
|
||
|
int052 tointegral -1.9 -> -2
|
||
|
|
||
|
-- numbers around precision
|
||
|
precision: 9
|
||
|
int060 tointegral '56267E-10' -> '0'
|
||
|
int061 tointegral '56267E-5' -> '1'
|
||
|
int062 tointegral '56267E-2' -> '563'
|
||
|
int063 tointegral '56267E-1' -> '5627'
|
||
|
int065 tointegral '56267E-0' -> '56267'
|
||
|
int066 tointegral '56267E+0' -> '56267'
|
||
|
int067 tointegral '56267E+1' -> '5.6267E+5'
|
||
|
int068 tointegral '56267E+2' -> '5.6267E+6'
|
||
|
int069 tointegral '56267E+3' -> '5.6267E+7'
|
||
|
int070 tointegral '56267E+4' -> '5.6267E+8'
|
||
|
int071 tointegral '56267E+5' -> '5.6267E+9'
|
||
|
int072 tointegral '56267E+6' -> '5.6267E+10'
|
||
|
int073 tointegral '56267E+995' -> '5.6267E+999'
|
||
|
|
||
|
int080 tointegral '-56267E-10' -> '0'
|
||
|
int081 tointegral '-56267E-5' -> '-1'
|
||
|
int082 tointegral '-56267E-2' -> '-563'
|
||
|
int083 tointegral '-56267E-1' -> '-5627'
|
||
|
int085 tointegral '-56267E-0' -> '-56267'
|
||
|
int086 tointegral '-56267E+0' -> '-56267'
|
||
|
int087 tointegral '-56267E+1' -> '-5.6267E+5'
|
||
|
int088 tointegral '-56267E+2' -> '-5.6267E+6'
|
||
|
int089 tointegral '-56267E+3' -> '-5.6267E+7'
|
||
|
int090 tointegral '-56267E+4' -> '-5.6267E+8'
|
||
|
int091 tointegral '-56267E+5' -> '-5.6267E+9'
|
||
|
int092 tointegral '-56267E+6' -> '-5.6267E+10'
|
||
|
int093 tointegral '-56267E+995' -> '-5.6267E+999'
|
||
|
|