## Featured Replies in this Discussion

- by LizR

0

Yes the compiler i used is Turbo Pascal unfortunately i checked if the CubeRoot & SquareRoot are computing correctly so i tested them turns out

`Ex when input X = 4`

The result:

```
SquareRoot := Sqrt(X); { Turn out correct 2.0000000000E+00 }
T1 := Trunc(X); { also correct 2 }
D1 := SquareRoot - T1; { is correct 0.0000000000E+00 }
{but with the cube is a different story }
CubeRoot := Exp( V * Ln(Z) ); { Turn out correct 1.5874010520E+00 }
T2 := Trunc(X); { also correct }
D2 := CubeRoot - T2; { is not correct 5.8740105200E-00 it should come out
{ 0.58740105200E+00 }
```

I also try to use the same program with Dev Pascal its seem to have the same problem with D1 :( it would seem that i cant calculate both of them in the same place

Question Answered as of 6 Years Ago by
LizR

You

This question has already been solved: Start a new discussion instead