Probably a rounding error if you increment by a real number. Try basing the loop on integers.

As Ricky said, if you post your code we can take a look

Ricky

2006-01-25 11:29:19

until the final loop where I get a tiny value

Why is a tiny value incorrect if you are trying to get values from 0 to 1?

If you are coding this on a computer or calculator, please, post your code.

Paul

2006-01-25 10:19:17

Hello

I have been trying to program some sine equations.

My hope has been to create a loop of 100 iterations to generate results from 0 to 1 which has been successful

I have started with i set to 0

I have incremented it by Pi/200 stopping when i gets to Pi/2

And sin(i) has produced 0 to 1 as hoped for.

The problem is how do I generate 0 to 1 to 0 again

I have tried stopping i when it gets to pi which works very well until the final loop where I get a tiny value. Can anyone help. Am i trying the impossible?