Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python
#8
Ok I have a harder one now, I have to get the sine function, based on this equation:
[Image: seno.png]
the input variables are x and p, p being precision, where the difference between the abs of 2 consecutive values has to be lower than p for the thing to be precise.

Once again, ignore my annotations as they are in spanish, and there's a lot of them:#neutros y contadores
 Spoiler
the example given to us is:
x: 0.5236
p: 0.01
output:0.500003192986

When I try it out, it looks like there's a problem with my 'frac' that goes to 0 and reaches an endless loop.
Any ideas on how to make it work?
Reply


Messages In This Thread
Python - by Manu - 2011-03-30, 03:19 PM
Python - by Fiel - 2011-03-30, 03:40 PM
Python - by Manu - 2011-03-30, 03:54 PM
Python - by Fiel - 2011-03-30, 04:04 PM
Python - by Manu - 2011-03-30, 07:03 PM
Python - by Fiel - 2011-03-30, 07:16 PM
Python - by Manu - 2011-03-30, 08:11 PM
Python - by Manu - 2011-03-31, 08:16 PM
Python - by Fiel - 2011-04-01, 03:12 AM
Python - by Manu - 2011-04-01, 08:27 PM
Python - by Fiel - 2011-04-01, 08:38 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)