<div dir="ltr">Hi All,<div><br></div><div>    an observation, a question and a suggestion.</div><div><br></div><div>First I hate seeing reports like this:</div><div><br></div><div><div>#55<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>0.33333298563957214<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>ratio of growth and image size at or above which a GC will be performed post scavenge</div><div><br></div><div>It's far preferable to see something like</div><div><br></div><div><div>#55<span class="gmail-Apple-tab-span" style="white-space:pre">      </span>0.333333<span class="gmail-Apple-tab-span" style="white-space:pre">      </span>ratio of growth and image size at or above which a GC will be performed post scavenge</div></div><div><br></div><div>but the Float printing facilities, , lose significant digits when the value is less than zero:</div><div><div><br></div><div>(-10 to: 10) collect: [:i| | v | v := (10 raisedTo: i) asFloat / 3.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">  </span>v printShowingMaxDecimalPlaces: 6] #('0' '0' '0' '0' '0' '0.000003' '0.000033' '0.000333' '0.003333' '0.033333' '0.333333' '3.333333' '33.333333' '333.333333' '3333.333333' '33333.333333' '333333.333333' '3333333.333333' '33333333.333333' '333333333.333333' '3333333333.333333')</div><div><br></div><div>(-10 to: 10) collect: [:i| | v | v := (10 raisedTo: i) asFloat / 3.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre">      </span>v printShowingDecimalPlaces: 6] #('0.000000' '0.000000' '0.000000' '0.000000' '0.000000' '0.000003' '0.000033' '0.000333' '0.003333' '0.033333' '0.333333' '3.333333' '33.333333' '333.333333' '3333.333333' '33333.333333' '333333.333333' '3333333.333333' '33333333.333333' '333333333.333333' '3333333333.333333')</div></div><div><br></div><div>So the question is, are there facilities I'm missing?</div><div><br></div><div>My suggestion is to add something like print:showingSignificantPlaces:, e.g.</div><div><div><br></div><div><br></div><div>(-10 to: 10) collect: [:i| | v | v := (10 raisedTo: i) asFloat / 3.</div><div><span class="gmail-Apple-tab-span" style="white-space:pre"> </span>(v >= 1 or: [v = 0 or: [v isFinite not]]) ifTrue: [v printShowingMaxDecimalPlaces: 6] ifFalse: [v printShowingMaxDecimalPlaces: 6 - v fractionPart log rounded]]  #('0.0000000000333333' '0.000000000333333' '0.00000000333333' '0.0000000333333' '0.000000333333' '0.00000333333' '0.0000333333' '0.000333333' '0.00333333' '0.0333333' '0.333333' '3.333333' '33.333333' '333.333333' '3333.333333' '33333.333333' '333333.333333' '3333333.333333' '33333333.333333' '333333333.333333' '3333333333.333333')</div></div><div><br></div><div>(e.g. 0.000333333333 fractionPart log =  -3.477121255153956)</div><div><br></div><div>If I'm not missing an obvious solution are there any objections to adding this?</div><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>