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: 
It's most likely because of the integer cast. Depending on your inputs, the results can be close and appear to have the same result because of rounding during the integer cast. Use double in your function instead.
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.