Skip to content

ValueError: factorial() not defined for negative values #2

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. >>> B = Bezier([(0.0, 0.0), (0.0, 1.0), (1.0, 1.0)])
2. B(0.5) or any other value between 0 and 1

What is the expected output? What do you see instead?
not sure what to expect really, just testing...

what I get is a traceback which points to the _C() function...

What version of the product are you using? On what operating system?
not sure which revision this is...
I just typed everything in, and triple checked the code to make sure it matched 
100%
(everything matches)

using XP Black with py272, but I don't think that matters :P


Please provide any additional information below.

I think it might be because no verification is done when calling _C()

the inputs at the thrown error are
xrange(3)[-1] = 2 # n
for i in xrange(3): # for i in _n
i == 0
_C(0, 2) # _C(i, n)
factorial(0 - 2) >>> error


@ your outside Q:
why did I type everything in?
I'm limited to using my wii for net,
and this wasn't an outrageously huge task XD

Original issue reported on code.google.com by tcll5850 on 15 Apr 2013 at 12:23

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions