<div dir="ltr"><div>Additional notes:</div><div><br></div><div>The signBit of real part is preserved as long as imaginary prints with sign -.</div>The signBit of imaginary part is not preserved.<br><br>(Complex real: -0.0 imaginary: -0.0) -> (-0.0 - 0.0i) -> (-0.0 + 0.0 i) -> (0.0 + 0.0 i)<br><br>(Complex real: -0.0 imaginary: 0.0) -> (-0.0 + 0.0 i) -> ( 0.0 + 0.0 i)<br><br>(Complex real: 0.0 imaginary: -0.0) -> (0.0 - 0.0 i) -> ( 0.0 + 0.0 i)<br><br>In Smallapack, where I had to print and re-interpret large complex matrices, i had to introduce selector (0.0 i: -0.0).<br><br>1. it is more efficient than arithmetic (which counts for large matrices)<br>2. it preserves the datas (as well as Number printString can preserve)<br><br>While 1 + 2 i can look nice and appealing, it gets quite nasty properties regarding above points...<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 22 nov. 2019 à 17:54, <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Nicolas Cellier uploaded a new version of Kernel to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Kernel-nice.1282.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/Kernel-nice.1282.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-nice.1282<br>
Author: nice<br>
Time: 22 November 2019, 5:54:28.478745 pm<br>
UUID: 70d4bc61-04e8-4cfd-befb-1b23f3f13953<br>
Ancestors: Kernel-mt.1281<br>
<br>
Let complex print the correct signBit of its imaginary part in case of negativeZero.<br>
<br>
Note: the signBit are not preserved upon reinterpretation.<br>
That's a problem of representation via arithmetic operation 1 + 2 i<br>
because we have this<br>
0.0 - 0.0 -> 0.0<br>
0.0 + (-0.0) -> 0.0<br>
(-0.0) + (-0.0) -> -0.0<br>
(-0.0) - 0.0 -> -0.0<br>
<br>
=============== Diff against Kernel-mt.1281 ===============<br>
<br>
Item was changed:<br>
  ----- Method: Complex>>printOn: (in category 'printing') -----<br>
  printOn: aStream<br>
        real printOn: aStream.<br>
        aStream nextPut: Character space.<br>
+       imaginary signBit = 0<br>
-       0 <= imaginary<br>
                ifTrue: [aStream nextPut: $+]<br>
                ifFalse: [aStream nextPut: $-].<br>
        aStream nextPut: Character space.<br>
        imaginary abs printOn: aStream.<br>
        aStream nextPut: Character space.<br>
        aStream nextPut: $i<br>
  !<br>
<br>
Item was changed:<br>
  ----- Method: Complex>>printOn:showingDecimalPlaces: (in category 'printing') -----<br>
  printOn: aStream showingDecimalPlaces: placesDesired<br>
        real printOn: aStream showingDecimalPlaces: placesDesired.<br>
        aStream nextPut: Character space.<br>
+       imaginary signBit = 0<br>
-       0 <= imaginary<br>
                ifTrue: [aStream nextPut: $+]<br>
                ifFalse: [aStream nextPut: $-].<br>
        aStream nextPut: Character space.<br>
        imaginary abs printOn: aStream showingDecimalPlaces: placesDesired.<br>
        aStream nextPut: Character space.<br>
        aStream nextPut: $i<br>
  !<br>
<br>
<br>
</blockquote></div>