#12498: Return Integer from GeneralDiscreteDistribution
--------------------------+-------------------------------------------------
   Reporter:  ppurka      |          Owner:  amhou                             
       Type:  defect      |         Status:  needs_review                      
   Priority:  minor       |      Milestone:  sage-5.0                          
  Component:  statistics  |       Keywords:  GeneralDiscreteDistribution import
Work_issues:              |       Upstream:  N/A                               
   Reviewer:              |         Author:                                    
     Merged:              |   Dependencies:                                    
--------------------------+-------------------------------------------------

Comment(by ppurka):

 Replying to [comment:4 kcrisman]:
 > Haven't tried to break this, but I don't see how having it being an
 Integer as opposed to int would lead to anything ''breaking''.  Does
 `gsl_ran_discrete` always return ints?
 >

 Yes. I believe `gsl_ran_discrete` always return ints. I ran into a problem
 with this because in one of my programs I was expecting that since I am
 always calling Sage commands, I will always get objects which are Sage
 objects and not python objects. At one point I was testing for the
 `parent()` of the number and it failed because `get_random_element()` was
 returning ints.

 Additionally, I think it should be Integer also for consistency. For
 example the other probability distributions return RDF instead of floats.

 > The patch ''does'' need a better commit message.

 It didn't have a commit message! Apparently, I forgot to put one. Updated
 the patch now.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12498#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
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