You were bitten by the fact that floating point numbers are not exact representations of decimals. Here is what I get:
DB<1> $a=0.335 DB<5> print sprintf("%.19f",$a) 0.3350000000000000200 DB<7> $b=1.335 DB<8> print sprintf("%.19f",$b) 1.3349999999999999645 DB<9>
Since 0.335 is represented internally as slightly larger than 0.335, it is rounded to 0.34, and 1.355 is slightly Less than 1.335, so it is rounded to 1.33.
Jim garrison
source share