04-20-2022, 02:34 AM
let me give an example to illustrate the difference between converting double to 16 digits and 15 digits as implemented in the C code above
output using unmodified QB64
Code: (Select All)
Dim As Double x
For x = -1 To 1 Step .1#
Print x
Next
Quote:-1output when using my modified qbs_str routine
-.9
-.8
-.7000000000000001
-.6000000000000001
-.5000000000000001
-.4000000000000001
-.3000000000000002
-.2000000000000001
-.1000000000000001
-1.387778780781446D-16
9.999999999999987D-02
.2
.3
.4
.5
.6
.6999999999999998
.7999999999999998
.8999999999999998
.9999999999999998
Quote:-1
-.9
-.8
-.7
-.6
-.5
-.4
-.3
-.2
-.1
-1.38777878078145D-16
.0999999999999999
.2
.3
.4
.5
.6
.7
.8
.9
1