Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String Math
#4
Testing Mr$ for adding and showDP for only 12 places of sum, using the StringMath 2025-04-01.bm
Code: (Select All)
_Title "StringMath 2025-04-01 test 1 add" ' b+ 2025-04-01

$Console:Only
Width 125
Randomize Timer

Dim As Double a, b
a = .00000000001919
b = .00000000009191
'a+b.00000000011110 check 9 0's and 4 1's

Print a, b
Print "a + b = "; showDP(mr$(N2S$(Str$(a)), "+", N2S$(Str$(b))), 12) ' show only 12 DP

'$Include: 'StringMath 2025-04-01.bm'

This illustrates how you can use Double Type to convert numbers calc'd in QB64 to String Math for higher precision stuff.
Which is a question that came up recently in PM.
b = b + ...
Reply


Messages In This Thread
String Math - by bplus - 03-31-2025, 10:43 PM
RE: String Math - by bplus - 04-01-2025, 01:35 PM
RE: String Math - by bplus - 04-01-2025, 04:24 PM
RE: String Math - by bplus - 04-01-2025, 04:30 PM
RE: String Math - by bplus - 04-02-2025, 12:47 PM



Users browsing this thread: 1 Guest(s)