/test/lib/numeric/real/test_real_constant04.e
Specman e | 65 lines | 39 code | 4 blank | 22 comment | 0 complexity | 11ba6d2f8b6193032478a054c2cdbdba MD5 | raw file
1-- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries. 2-- See the Copyright notice at the end of this file. 3-- 4class TEST_REAL_CONSTANT04 5 -- Test the normalisation in {REAL_CONSTANT}.make 6 7inherit 8 EIFFELTEST_TOOLS 9 10create {} 11 make 12 13feature {ANY} 14 make 15 local 16 ref: REAL 17 do 18 ref := 0.1 19 assert(ref = 1e-1) 20 assert(ref = 0.1) 21 assert(ref = 1.0e-1) 22 ref := 21.0 23 assert(ref = 210000000000e-10) 24 assert(ref = 21000000000E-9) 25 assert(ref = 2100000000e-8) 26 assert(ref = 210000000E-7) 27 assert(ref = 21000000e-6) 28 assert(ref = 2100000E-5) 29 assert(ref = 210000e-4) 30 assert(ref = 21000E-3) 31 assert(ref = 2100e-2) 32 assert(ref = 210E-01) 33 assert(ref = 21) 34 assert(ref = 21e0) 35 assert(ref = 2.1E1) 36 assert(ref = 0.21e2) 37 assert(ref = 0.021E3) 38 assert(ref = 0.0021e4) 39 assert(ref = 0.00021E5) 40 assert(ref = 0.000021e6) 41 assert(ref = 0.0000021E7) 42 assert(ref = 0.00000021e8) 43 assert(ref = 0.000000021E9) 44 assert(ref = 0.0000000021E10) 45 end 46 47end -- class TEST_REAL_CONSTANT04 48-- 49-- ------------------------------------------------------------------------------------------------------------------------------ 50-- Copyright notice below. Please read. 51-- 52-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, 53-- as published by the Free Software Foundation; either version 2, or (at your option) any later version. 54-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty 55-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have 56-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free 57-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 58-- 59-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE 60-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE 61-- 62-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN 63-- 64-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr 65-- ------------------------------------------------------------------------------------------------------------------------------