/test/lib/numeric/number/test_number101.e

http://github.com/tybor/Liberty · Specman e · 57 lines · 25 code · 7 blank · 25 comment · 0 complexity · 6839226cd7ad21306e62eb28eeecd9ea 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. --
  4. class TEST_NUMBER101
  5. --
  6. -- Test of depassement of INTEGER_64_NUMBER capacity
  7. -- Result is BIG_INTEGER_NUMBER which is > Maximum_integer_64
  8. --
  9. insert
  10. EIFFELTEST_TOOLS
  11. ANY
  12. PLATFORM
  13. create {}
  14. make
  15. feature {ANY}
  16. make
  17. local
  18. n: NUMBER
  19. do
  20. n := nt.from_integer_64(Maximum_integer_64)
  21. n := n @+ Maximum_integer_64
  22. n := n @- Maximum_integer_64
  23. assert(n.is_integer_64)
  24. assert(n @= Maximum_integer_64)
  25. n := nt.from_integer_64(Maximum_integer_64)
  26. n := n @* 2
  27. n := n @/ 2
  28. assert(n.is_integer_64)
  29. assert(n @= Maximum_integer_64)
  30. end
  31. nt: NUMBER_TOOLS
  32. end -- class TEST_NUMBER101
  33. --
  34. -- ------------------------------------------------------------------------------------------------------------------------------
  35. -- Copyright notice below. Please read.
  36. --
  37. -- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
  38. -- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
  39. -- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
  40. -- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
  41. -- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
  42. -- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  43. --
  44. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  45. -- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  46. --
  47. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  48. --
  49. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  50. -- ------------------------------------------------------------------------------------------------------------------------------