#4746: Bug in srange
---------------------+------------------------------------------------------
 Reporter:  vgermrk  |       Owner:  cwitty
     Type:  defect   |      Status:  new   
 Priority:  major    |   Milestone:        
Component:  misc     |    Keywords:        
---------------------+------------------------------------------------------
 One can produce almost every (wrong) behavior concerning the endpoint
 of the returned list. Here are some examples:[[BR]]

 {{{
 sage: srange(0.5,1.1,0.1,include_endpoint=False)
 [0.500000000000000,
  0.600000000000000,
  0.700000000000000,
  0.800000000000000,
  0.900000000000000,
  1.00000000000000,
  1.10000000000000]

 sage: srange(0.5,1,0.1,include_endpoint=False)
 [0.500000000000000,
  0.600000000000000,
  0.700000000000000,
  0.800000000000000,
  0.900000000000000]

 sage: srange(0.5,0.9,0.1,include_endpoint=False)
 [0.500000000000000, 0.600000000000000, 0.700000000000000,
 0.800000000000000]

 sage: srange(0,1.1,0.1,include_endpoint=True)
 [0.000000000000000,
  0.100000000000000,
  0.200000000000000,
  0.300000000000000,
  0.400000000000000,
  0.500000000000000,
  0.600000000000000,
  0.700000000000000,
  0.800000000000000,
  0.900000000000000,
  1.00000000000000,
  1.10000000000000,
  1.20000000000000]

 sage: srange(0,0.2,0.1,include_endpoint=True)
 [0.000000000000000, 0.100000000000000, 0.200000000000000]

 sage: srange(0,0.3,0.1,include_endpoint=True)
 [0.000000000000000, 0.100000000000000, 0.200000000000000]
 }}}

 -MRK-

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4746>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to