Thanks, that was what was happening.
On 07/07/2017 08:29 PM, alex_ca wrote:
I'm having trouble understanding why in some cases a double value will
be rounded up and other times down, for the same code. Here's a snippet
with code I tried to debug:
int getNumberOfStitchesForRowLength(double rowLength)
{
writeln("input ",
On 07/07/2017 11:29 AM, alex_ca wrote:
> input 2.5 10 10
> stitches: 2.5 -> 2
> I expect: 3
That's because what is printed as 2.5 is actually a little less than
that. (Try printing with a format string like "%.20f".)
The common way of dealing with this issue is to add 0.5 before the
conversi
Hi,
I'm having trouble understanding why in some cases a double value
will be rounded up and other times down, for the same code.
Here's a snippet with code I tried to debug:
int getNumberOfStitchesForRowLength(double rowLength)
{
writeln("input ", rowLength, " ", currentGauge.stitch_