Question: I'm making a REST call and receiving this XML back:

```
<replacement><![CDATA[this is &amp; ampersand]]></replacement>

```

I've substringed out the bit that I really care about:

```
this is &amp; ampersand

```

How do I now decode this snippet into (I'm not using yaws):

```
this is & ampersand

```

Answer: 
You're going to get a lot of error due to the fact that you're using `int` everywhere. `float` or `double` would be a better choice. This alone could explain why you're getting the same results despite entering different values. For example, `int flow=0.25*x` would give the same value for `flow` for all x where x > -4 and x < 4.
You are doing floating point arithmetic and returning the result to int. I would change variables to floats or doubles were needed.