Author Topic: Converting real4 to string  (Read 18964 times)

dedndave

  • Member
  • *****
  • Posts: 8808
  • Still using Abacus 2.0
    • DednDave
Re: Converting real4 to string
« Reply #30 on: April 27, 2013, 12:37:08 AM »
you have to increment the exponent AFTER you make the "invalid test"

got mine working - i need to do more testing and cleanup before i post
Code: [Select]
0000_00000000_00000000: 00000000 00000002 +0
8000_00000000_00000000: 00000000 00000002 -0
0000_00000000_00000001: 00000000 0000001D +3.64519953188247460253e-4951
0000_7FFFFFFF_FFFFFFFF: 00000000 0000001C +3.3621031431120935059e-4932
0000_80000000_00000000: 00000000 0000001D +3.36210314311209350626e-4932
0000_FFFFFFFF_FFFFFFFF: 00000000 0000001D +6.72420628622418701216e-4932
0001_00000000_00000000: 00000006 00000007 Invalid
7FFE_7FFFFFFF_FFFFFFFF: 00000006 00000007 Invalid
0001_80000000_00000000: 00000000 0000001D +3.36210314311209350626e-4932
4000_C90FDAA2_2168C235: 00000000 00000017 +3.14159265358979323851
7FFE_FFFFFFFF_FFFFFFFF: 00000000 0000001D +1.18973149535723176502e+4932
7FFF_00000000_00000000: 00000006 00000007 Invalid
7FFF_7FFFFFFF_FFFFFFFF: 00000006 00000007 Invalid
7FFF_80000000_00000000: 00000001 00000002 +∞
FFFF_80000000_00000000: 00000001 00000002 -∞
7FFF_80000000_00000001: 00000005 00000004 SNaN
7FFF_BFFFFFFF_FFFFFFFF: 00000005 00000004 SNaN
7FFF_C0000000_00000000: 00000003 0000000F Indefinite QNaN
7FFF_C0000000_00000001: 00000004 00000004 QNaN
7FFF_FFFFFFFF_FFFFFFFF: 00000004 00000004 QNaN
Code: [Select]
00000000: 00000000 00000002 +0
80000000: 00000000 00000002 -0
00000001: 00000000 0000000F +1.40129846e-45
007FFFFF: 00000000 0000000F +1.17549421e-38
00800000: 00000000 0000000F +1.17549435e-38
BF800000: 00000000 00000002 -1
7F7FFFFF: 00000000 0000000F +3.40282347e+38
7F800000: 00000001 00000002 +∞
FF800000: 00000001 00000002 -∞
7F800001: 00000002 00000003 NaN
7FFFFFFF: 00000002 00000003 NaN
Code: [Select]
00000000_00000000: 00000000 00000002 +0
80000000_00000000: 00000000 00000002 -0
00000000_00000001: 00000000 00000018 +4.9406564584124654e-324
000FFFFF_FFFFFFFF: 00000000 00000018 +2.2250738585072009e-308
00100000_00000000: 00000000 00000018 +2.2250738585072014e-308
BFF00000_00000000: 00000000 00000002 -1
7FEFFFFF_FFFFFFFF: 00000000 00000018 +1.7976931348623157e+308
7FF00000_00000000: 00000001 00000002 +∞
FFF00000_00000000: 00000001 00000002 -∞
7FF00000_00000001: 00000002 00000003 NaN
7FFFFFFF_FFFFFFFF: 00000002 00000003 NaN

or, if you like more digits...
Code: [Select]
0000_00000000_00000000: 00000000 00000002 +0
8000_00000000_00000000: 00000000 00000002 -0
0000_00000000_00000001: 00000000 00000025 +3.6451995318824746025284059336e-4951
0000_7FFFFFFF_FFFFFFFF: 00000000 00000025 +3.3621031431120935058981578641e-4932
0000_80000000_00000000: 00000000 00000025 +3.3621031431120935062626778173e-4932
0000_FFFFFFFF_FFFFFFFF: 00000000 00000025 +6.7242062862241870121608356815e-4932
0001_00000000_00000000: 00000006 00000007 Invalid
7FFE_7FFFFFFF_FFFFFFFF: 00000006 00000007 Invalid
0001_80000000_00000000: 00000000 00000025 +3.3621031431120935062626778173e-4932
4000_C90FDAA2_2168C235: 00000000 0000001F +3.1415926535897932385128089594
7FFE_FFFFFFFF_FFFFFFFF: 00000000 00000024 +1.189731495357231765021263853e+4932
7FFF_00000000_00000000: 00000006 00000007 Invalid
7FFF_7FFFFFFF_FFFFFFFF: 00000006 00000007 Invalid
7FFF_80000000_00000000: 00000001 00000002 +∞
FFFF_80000000_00000000: 00000001 00000002 -∞
7FFF_80000000_00000001: 00000005 00000004 SNaN
7FFF_BFFFFFFF_FFFFFFFF: 00000005 00000004 SNaN
7FFF_C0000000_00000000: 00000003 0000000F Indefinite QNaN
7FFF_C0000000_00000001: 00000004 00000004 QNaN
7FFF_FFFFFFFF_FFFFFFFF: 00000004 00000004 QNaN
Code: [Select]
00000000: 00000000 00000002 +0
80000000: 00000000 00000002 -0
00000001: 00000000 00000033 +1.40129846432481707092372958328991613128026194e-45
007FFFFF: 00000000 00000033 +1.17549421069244107548702944484928734882705243e-38
00800000: 00000000 00000033 +1.17549435082228750796873653722224567781866556e-38
BF800000: 00000000 00000002 -1
7F7FFFFF: 00000000 0000002C +3.4028234663852885981170418348451692544e+38
7F800000: 00000001 00000002 +∞
FF800000: 00000001 00000002 -∞
7F800001: 00000002 00000003 NaN
7FFFFFFF: 00000002 00000003 NaN
Code: [Select]
00000000_00000000: 00000000 00000002 +0
80000000_00000000: 00000000 00000002 -0
00000000_00000001: 00000000 0000002A +4.9406564584124654417656879286822137e-324
000FFFFF_FFFFFFFF: 00000000 0000002A +2.2250738585072008890245868760858599e-308
00100000_00000000: 00000000 0000002A +2.2250738585072013830902327173324041e-308
BFF00000_00000000: 00000000 00000002 -1
7FEFFFFF_FFFFFFFF: 00000000 0000002A +1.7976931348623157081452742373170436e+308
7FF00000_00000000: 00000001 00000002 +∞
FFF00000_00000000: 00000001 00000002 -∞
7FF00000_00000001: 00000002 00000003 NaN
7FFFFFFF_FFFFFFFF: 00000002 00000003 NaN

more digits available upon request   :P

RuiLoureiro

  • Member
  • ****
  • Posts: 797
Re: Converting real4 to string
« Reply #31 on: April 27, 2013, 04:35:58 AM »
Here are my results with 19 digits, 18 decimal places
I am converting the qword integer to digits, not BCD.
I used Olly to see some steps about Denormal

0000_80000000_00000000 = 3.36210314311209351E-4932
0000_FFFFFFFF_FFFFFFFF     = 6.72420628622418702E-4932
0000_00000000_00000001 =ERROR  <-- FPU doesnt load it, gives error (fld tbyte ptr ... => error)
0000_FFFFFFFF_FFFFFFFF =ERROR  <--        "     "        "     "
7FFF_80000000_00000000 =+INFINITY
FFFF_80000000_00000000 =-INFINITY
7FFE_FFFFFFFF_FFFFFFFF = 1.189731495357231998E+4932
FFFE_FFFFFFFF_FFFFFFFF =-1.189731495357231998E+4932

Here our results
I dont know why, but the LimitReal10
are not the same.
I will try another way to see if
it gives the same result.

;------------------------------------------
;8000_0000_0000_0000 to FFFF_FFFF_FFFF_FFFF   Signed Pseudo-Denormal
;------------------------------------------

;0000_80000000_00000000:            +3.36210314311209350626e-4932
_DemormalI2     dd 00000000h          ; 3.36210314311209351   E-4932    - Pseudo-Denormal
                dd 80000000h
                dw 0
;0000_FFFFFFFF_FFFFFFFF:            +6.72420628622418701216e-4932               
_DemormalE2     dd 0FFFFFFFFh     ; 6.72420628622418702   E-4932 - Pseudo-Denormal
                dd 0FFFFFFFFh
                dw 0
;7FFE_FFFFFFFF_FFFFFFFF:                 +1.18973149535723176502e+4932
_LimitReal10_1  dd 0FFFFFFFFh          ; 1.189731495357231998  E+4932
                dd 0FFFFFFFFh
                dw 7FFEh
;FFFE_FFFFFFFF_FFFFFFFF:                 +1.18973149535723176502e+4932               
_LimitReal10_2  dd 0FFFFFFFFh         ; -1.189731495357231998  E+4932
                dd 0FFFFFFFFh
                dw 0FFFEh
Quote
more digits available upon request
            I am the wrong target. Write it
            to that people that get only 21 digits
            and dont say how they get it !!!  :bgrin:

dedndave

  • Member
  • *****
  • Posts: 8808
  • Still using Abacus 2.0
    • DednDave
Re: Converting real4 to string
« Reply #32 on: April 27, 2013, 04:50:27 AM »
lol - well, i am writing this to be used a different way
i am sure yours are much faster than mine   :P

i wanted a tool that would allow me to see the digits beyond usable resolution
now, if i want to know how much difference there is by adding or subtracting 1 LSB, i can

RuiLoureiro

  • Member
  • ****
  • Posts: 797
Re: Converting real4 to string
« Reply #33 on: April 27, 2013, 05:01:17 AM »
I have no way to do it in another way, but
it is a FPU rounding question because when
i use 17 decimal places (18 digits) it gives 77 not 998.
It's all, Dave  :t

 :biggrin:
Ohhh 77 is what you get !!!  :biggrin:

EDIT:
well, i will post one version of real10 to string

RuiLoureiro

  • Member
  • ****
  • Posts: 797
Re: Converting real4 to string
« Reply #34 on: April 27, 2013, 07:46:02 AM »
Here one complete example from one proc that
uses BCD - and compress table - 18 digits
(i wrote 11 procedures)
Code: [Select]
0000_80000000_00000000 = 3.3621031431120935E-4932
0000_FFFFFFFF_FFFFFFFF = 6.724206286224187E-4932
0000_00000000_00000001 =ERROR
0000_FFFFFFFF_FFFFFFFF =ERROR
7FFF_80000000_00000000 =+INFINITY
FFFF_80000000_00000000 =-INFINITY
7FFE_FFFFFFFF_FFFFFFFF = 1.18973149535723177E+4932
FFFE_FFFFFFFF_FFFFFFFF =-1.18973149535723177E+4932
 *** STOP - ConvertFloat10CT  end test digits ***
 0
 1.0
 2.0
 3.0
 4.0
 5.0
 6.0
 7.0
 8.0
 9.0
 0.1
 0.2
 0.3
 0.4
 0.5
 0.6
 0.7
 0.8
 0.9
 *** STOP - ConvertFloat10CT  end test digits ***
-1.1
-11.1
-111.1
-1111.1
-11111.1
-111111.1
-1111111.1
-11111111.1
-111111111.1
-1111111111.1
-11111111111.1
-111111111111.1
-1111111111111.1
-11111111111111.1
-111111111111111.1
-1111111111111111.1
-11111111111111111.1
-111111111111111111
-2.2
-22.2
-222.2
-2222.2
-22222.2
-222222.2
-2222222.2
-22222222.2
-222222222.2
-2222222222.2
-22222222222.2
-222222222222.2
-2222222222222.2
-22222222222222.2
-222222222222222.2
-2222222222222222.2
-22222222222222222.2
-222222222222222222
-3.3
-33.3
-333.3
-3333.3
-33333.3
-333333.3
-3333333.3
-33333333.3
-333333333.3
-3333333333.3
-33333333333.3
-333333333333.3
-3333333333333.3
-33333333333333.3
-333333333333333.3
-3333333333333333.3
-33333333333333333.3
-333333333333333333
 *** STOP - ConvertFloat10CT ***
-4.4
-44.4
-444.4
-4444.4
-44444.4
-444444.4
-4444444.4
-44444444.4
-444444444.4
-4444444444.4
-44444444444.4
-444444444444.4
-4444444444444.4
-44444444444444.4
-444444444444444.4
-4444444444444444.4
-44444444444444444
-444444444444444444
-5.5
-55.5
-555.5
-5555.5
-55555.5
-555555.5
-5555555.5
-55555555.5
-555555555.5
-5555555555.5
-55555555555.5
-555555555555.5
-5555555555555.5
-55555555555555.5
-555555555555555.5
-5555555555555555.5
-55555555555555556
-555555555555555556
-6.6
-66.6
-666.6
-6666.6
-66666.6
-666666.6
-6666666.6
-66666666.6
-666666666.6
-6666666666.6
-66666666666.6
-666666666666.6
-6666666666666.6
-66666666666666.6
-666666666666666.6
-6666666666666666.6
-66666666666666667
-6.6666666666666667E+17
-7.7
-77.7
-777.7
-7777.7
-77777.7
-777777.7
-7777777.7
-77777777.7
-777777777.7
-7777777777.7
-77777777777.7
-777777777777.7
-7777777777777.7
-77777777777777.7
-777777777777777.7
-7777777777777777.7
-77777777777777778
-7.7777777777777778E+17
 *** STOP - ConvertFloat10CT ***
-8.8
-88.8
-888.8
-8888.8
-88888.8
-888888.8
-8888888.8
-88888888.8
-888888888.8
-8888888888.8
-88888888888.8
-888888888888.8
-8888888888888.8
-88888888888888.8
-888888888888888.8
-8888888888888888.8
-88888888888888889
-8.8888888888888889E+17
-9.9
-99.9
-999.9
-9999.9
-99999.9
-999999.9
-9999999.9
-99999999.9
-999999999.9
-9999999999.9
-99999999999.9
-999999999999.9
-9999999999999.9
-99999999999999.9
-999999999999999.9
-9999999999999999.9
-100000000000000000
-1.0E+18
 *** STOP - ConvertFloat10CT ***
 0.1
 0.01
 0.001
 0.0001
 0.00001
 0.000001
 0.0000001
 0.00000001
 0.000000001
 0.0000000001
 0.00000000001
 0.000000000001
 0.0000000000001
 0.00000000000001
 0.000000000000001
 0.0000000000000001
 1.0E-17
 1.0E-18
 *** STOP - ConvertFloat10CT ***
 0.2
 0.02
 0.002
 0.0002
 0.00002
 0.000002
 0.0000002
 0.00000002
 0.000000002
 0.0000000002
 0.00000000002
 0.000000000002
 0.0000000000002
 0.00000000000002
 0.000000000000002
 0.0000000000000002
 2.0E-17
 2.0E-18
 *** STOP - ConvertFloat10CT ***
 0.3
 0.03
 0.003
 0.0003
 0.00003
 0.000003
 0.0000003
 0.00000003
 0.000000003
 0.0000000003
 0.00000000003
 0.000000000003
 0.0000000000003
 0.00000000000003
 0.000000000000003
 0.0000000000000003
 3.0E-17
 3.0E-18
 *** STOP - ConvertFloat10CT ***
 0.4
 0.04
 0.004
 0.0004
 0.00004
 0.000004
 0.0000004
 0.00000004
 0.000000004
 0.0000000004
 0.00000000004
 0.000000000004
 0.0000000000004
 0.00000000000004
 0.000000000000004
 0.0000000000000004
 4.0E-17
 4.0E-18
 *** STOP - ConvertFloat10CT ***
 0.5
 0.05
 0.005
 0.0005
 0.00005
 0.000005
 0.0000005
 0.00000005
 0.000000005
 0.0000000005
 0.00000000005
 0.000000000005
 0.0000000000005
 0.00000000000005
 0.000000000000005
 5.0E-16
 5.0E-17
 5.0E-18
 *** STOP - ConvertFloat10CT ***
 0.6
 0.06
 0.006
 0.0006
 0.00006
 0.000006
 0.0000006
 0.00000006
 0.000000006
 0.0000000006
 0.00000000006
 0.000000000006
 0.0000000000006
 0.00000000000006
 0.000000000000006
 6.0E-16
 6.0E-17
 6.0E-18
 *** STOP - ConvertFloat10CT ***
 0.7
 0.07
 0.007
 0.0007
 0.00007
 0.000007
 0.0000007
 0.00000007
 0.000000007
 0.0000000007
 0.00000000007
 0.000000000007
 0.0000000000007
 0.00000000000007
 0.000000000000007
 7.0E-16
 7.0E-17
 7.0E-18
 *** STOP - ConvertFloat10CT ***
 0.8
 0.08
 0.008
 0.0008
 0.00008
 0.000008
 0.0000008
 0.00000008
 0.000000008
 0.0000000008
 0.00000000008
 0.000000000008
 0.0000000000008
 0.00000000000008
 0.000000000000008
 8.0E-16
 8.0E-17
 8.0E-18
 *** STOP - ConvertFloat10CT ***
 0.9
 0.09
 0.009
 0.0009
 0.00009
 0.000009
 0.0000009
 0.00000009
 0.000000009
 0.0000000009
 0.00000000009
 0.000000000009
 0.0000000000009
 0.00000000000009
 0.000000000000009
 9.0E-16
 9.0E-17
 9.0E-18
 *** STOP - ConvertFloat10CT ***
-1.23456789123456
-12.3456789123456
-123.456789123456
-1234.56789123456
-12345.6789123456
-123456.789123456
-1234567.89123456
-12345678.9123456
-12345678.9123456
-123456789.123456
-1234567891.123456
-12345678912.123456
-123456789123.123456
-1234567891234.12346
-12345678912345.1235
-123456789123456.123
-1234567891234567.12
-12345678912345678.1
-123456789123456789
 *** STOP - ConvertFloat10CT --- E N D ---***

Here another - direct - 18 digits

Code: [Select]
0000_80000000_00000000 =3.3621031431120935E-4932
0000_FFFFFFFF_FFFFFFFF =6.724206286224187E-4932
0000_00000000_00000001 =ERROR
0000_FFFFFFFF_FFFFFFFF =ERROR
7FFF_80000000_00000000 =+INFINITY
FFFF_80000000_00000000 =-INFINITY
7FFE_FFFFFFFF_FFFFFFFF =1.18973149535723177E+4932
FFFE_FFFFFFFF_FFFFFFFF =1.18973149535723177E+4932
 *** STOP - ConvertFloat10DX  end test digits ***
 0
1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
 *** STOP - ConvertFloat10DX  end test digits ***
1.1
11.1
111.1
1111.1
11111.1
111111.1
1111111.1
11111111.1
111111111.1
1111111111.1
11111111111.1
111111111111.1
1111111111111.1
11111111111111.1
111111111111111.1
1111111111111111.1
11111111111111111.1
1.11111111111111111E+17
2.2
22.2
222.2
2222.2
22222.2
222222.2
2222222.2
22222222.2
222222222.2
2222222222.2
22222222222.2
222222222222.2
2222222222222.2
22222222222222.2
222222222222222.2
2222222222222222.2
22222222222222222.2
2.22222222222222222E+17
3.3
33.3
333.3
3333.3
33333.3
333333.3
3333333.3
33333333.3
333333333.3
3333333333.3
33333333333.3
333333333333.3
3333333333333.3
33333333333333.3
333333333333333.3
3333333333333333.3
33333333333333333.3
3.33333333333333333E+17
 *** STOP - ConvertFloat10DX ***
4.4
44.4
444.4
4444.4
44444.4
444444.4
4444444.4
44444444.4
444444444.4
4444444444.4
44444444444.4
444444444444.4
4444444444444.4
44444444444444.4
444444444444444.4
4444444444444444.4
44444444444444444
4.44444444444444444E+17
5.5
55.5
555.5
5555.5
55555.5
555555.5
5555555.5
55555555.5
555555555.5
5555555555.5
55555555555.5
555555555555.5
5555555555555.5
55555555555555.5
555555555555555.5
5555555555555555.5
55555555555555556
5.55555555555555556E+17
6.6
66.6
666.6
6666.6
66666.6
666666.6
6666666.6
66666666.6
666666666.6
6666666666.6
66666666666.6
666666666666.6
6666666666666.6
66666666666666.6
666666666666666.6
6666666666666666.6
66666666666666667
6.6666666666666667E+17
7.7
77.7
777.7
7777.7
77777.7
777777.7
7777777.7
77777777.7
777777777.7
7777777777.7
77777777777.7
777777777777.7
7777777777777.7
77777777777777.7
777777777777777.7
7777777777777777.7
77777777777777778
7.7777777777777778E+17
 *** STOP - ConvertFloat10DX ***
8.8
88.8
888.8
8888.8
88888.8
888888.8
8888888.8
88888888.8
888888888.8
8888888888.8
88888888888.8
888888888888.8
8888888888888.8
88888888888888.8
888888888888888.8
8888888888888888.8
88888888888888889
8.8888888888888889E+17
9.9
99.9
999.9
9999.9
99999.9
999999.9
9999999.9
99999999.9
999999999.9
9999999999.9
99999999999.9
999999999999.9
9999999999999.9
99999999999999.9
999999999999999.9
9999999999999999.9
1.0E+17
1.0E+18
 *** STOP - ConvertFloat10DX ***
0.1
0.01
0.001
0.0001
0.00001
0.000001
0.0000001
0.00000001
0.000000001
0.0000000001
0.00000000001
0.000000000001
0.0000000000001
0.00000000000001
0.000000000000001
0.0000000000000001
0.00000000000000001
1.0E-18
 *** STOP - ConvertFloat10DX ***
0.2
0.02
0.002
0.0002
0.00002
0.000002
0.0000002
0.00000002
0.000000002
0.0000000002
0.00000000002
0.000000000002
0.0000000000002
0.00000000000002
0.000000000000002
0.0000000000000002
0.00000000000000002
2.0E-18
 *** STOP - ConvertFloat10DX ***
0.3
0.03
0.003
0.0003
0.00003
0.000003
0.0000003
0.00000003
0.000000003
0.0000000003
0.00000000003
0.000000000003
0.0000000000003
0.00000000000003
0.000000000000003
0.0000000000000003
0.00000000000000003
3.0E-18
 *** STOP - ConvertFloat10DX ***
0.4
0.04
0.004
0.0004
0.00004
0.000004
0.0000004
0.00000004
0.000000004
0.0000000004
0.00000000004
0.000000000004
0.0000000000004
0.00000000000004
0.000000000000004
0.0000000000000004
0.00000000000000004
4.0E-18
 *** STOP - ConvertFloat10DX ***
0.5
0.05
0.005
0.0005
0.00005
0.000005
0.0000005
0.00000005
0.000000005
0.0000000005
0.00000000005
0.000000000005
0.0000000000005
0.00000000000005
0.000000000000005
0.0000000000000005
0.00000000000000005
5.0E-18
 *** STOP - ConvertFloat10DX ***
0.6
0.06
0.006
0.0006
0.00006
0.000006
0.0000006
0.00000006
0.000000006
0.0000000006
0.00000000006
0.000000000006
0.0000000000006
0.00000000000006
0.000000000000006
0.0000000000000006
0.00000000000000006
6.0E-18
 *** STOP - ConvertFloat10DX ***
0.7
0.07
0.007
0.0007
0.00007
0.000007
0.0000007
0.00000007
0.000000007
0.0000000007
0.00000000007
0.000000000007
0.0000000000007
0.00000000000007
0.000000000000007
0.0000000000000007
0.00000000000000007
7.0E-18
 *** STOP - ConvertFloat10DX ***
0.8
0.08
0.008
0.0008
0.00008
0.000008
0.0000008
0.00000008
0.000000008
0.0000000008
0.00000000008
0.000000000008
0.0000000000008
0.00000000000008
0.000000000000008
0.0000000000000008
0.00000000000000008
8.0E-18
 *** STOP - ConvertFloat10DX ***
0.9
0.09
0.009
0.0009
0.00009
0.000009
0.0000009
0.00000009
0.000000009
0.0000000009
0.00000000009
0.000000000009
0.0000000000009
0.00000000000009
0.000000000000009
0.0000000000000009
0.00000000000000009
9.0E-18
 *** STOP - ConvertFloat10DX ***
1.23456789123456
12.3456789123456
123.456789123456
1234.56789123456
12345.6789123456
123456.789123456
1234567.89123456
12345678.9123456
12345678.9123456
123456789.123456
1234567891.123456
12345678912.123456
123456789123.123456
1234567891234.12346
12345678912345.1235
123456789123456.123
1234567891234567.12
12345678912345678.1
1.23456789123456789E+17
 *** STOP - ConvertFloat10DX --- E N D ---***

dedndave

  • Member
  • *****
  • Posts: 8808
  • Still using Abacus 2.0
    • DednDave
Re: Converting real4 to string
« Reply #35 on: April 27, 2013, 12:37:39 PM »
i am a little suprised that the FPU won't load those values

however, there is a work around

for pseudo-denormals (bit 63 = 1), you can increment the exponent and evaluate it - those are easy
0000_FFFFFFFF_FFFFFFFF = 0001_FFFFFFFF_FFFFFFFF

for denormals (bit 63 = 0), you can left shift the fraction until bit 63 is 1, keeping track of the count
increment the exponent and load it, then divide by 2^(shift count) in the FPU and evaluate the result
sounds good, in theory, anyways   :P

otherwise, your values look pretty good   :t

dedndave

  • Member
  • *****
  • Posts: 8808
  • Still using Abacus 2.0
    • DednDave
Re: Converting real4 to string
« Reply #36 on: April 27, 2013, 01:26:08 PM »
the routine is finished, although, i want to write a little app that allows command-line hex reals

anyways, this is the test program - i thought you might like to play with it

let me know if you find errors, please - you can be my beta guy   :P

jj2007

  • Member
  • *****
  • Posts: 8731
  • Assembler is fun ;-)
    • MasmBasic
Re: Converting real4 to string
« Reply #37 on: April 27, 2013, 03:27:05 PM »
Seems to work fine, Dave :t

I wish I'd had had this valuable resource when I designed Str$() - it would have made many things easier. Great job, young friend :icon14:

dedndave

  • Member
  • *****
  • Posts: 8808
  • Still using Abacus 2.0
    • DednDave
Re: Converting real4 to string
« Reply #38 on: April 27, 2013, 04:52:51 PM »
thanks, Jochen   :t

the one i had back then shifted the ascii string left or right - very slow
but - all you had to do was ask   :P

i am working on a little command-line tool that allows hex entry on the command line
it will also allow 2 switches - one to do steps x-(1 lsb), x, x+(1 lsb), one to do full precision
i will probably post that one in the ling long kai fang thread

maybe when i get better - not feeling well - i may go to the hospital   :(

Gunther

  • Member
  • *****
  • Posts: 3585
  • Forgive your enemies, but never forget their names
Re: Converting real4 to string
« Reply #39 on: April 27, 2013, 08:08:16 PM »
Dave,

maybe when i get better - not feeling well - i may go to the hospital   :(

that's bad news, old friend. What's wrong?

Gunther
Get your facts first, and then you can distort them.

RuiLoureiro

  • Member
  • ****
  • Posts: 797
Re: Converting real4 to string
« Reply #40 on: April 27, 2013, 08:20:16 PM »
maybe when i get better - not feeling well - i may go to the hospital   :(
               I hope you feel better very soon, Dave :t

FORTRANS

  • Member
  • *****
  • Posts: 1016
Re: Converting real4 to string
« Reply #41 on: April 27, 2013, 09:44:18 PM »
Hi Dave,

   Get well soon.

Good luck,

Steve

dedndave

  • Member
  • *****
  • Posts: 8808
  • Still using Abacus 2.0
    • DednDave
Re: Converting real4 to string
« Reply #42 on: April 27, 2013, 10:33:33 PM »
thanks, guys   :t

i went to the hospital - turned out to be a minor stomach problem   :P
you won't get rid of me, that easily - lol

Gunther

  • Member
  • *****
  • Posts: 3585
  • Forgive your enemies, but never forget their names
Re: Converting real4 to string
« Reply #43 on: April 27, 2013, 10:48:28 PM »
Hi Dave,


thanks, guys   :t

i went to the hospital - turned out to be a minor stomach problem   :P

that sounds like blessing in disguise. I hope you've a good medical insurance.

Gunther
Get your facts first, and then you can distort them.

jj2007

  • Member
  • *****
  • Posts: 8731
  • Assembler is fun ;-)
    • MasmBasic
Re: Converting real4 to string
« Reply #44 on: April 28, 2013, 12:27:27 AM »
i went to the hospital - turned out to be a minor stomach problem   :P

Confess that you just wanted a gentle belly massage by some cute gal :biggrin: