Author Topic: Ling Long Kai Fang Bignum to ASCII  (Read 13201 times)

dedndave

  • Member
  • *****
  • Posts: 8829
  • Still using Abacus 2.0
    • DednDave
Ling Long Kai Fang Bignum to ASCII
« on: June 06, 2012, 03:43:10 AM »
these are my Ling Long Kai Fang routines from the old forum

LLKF9_1a:
3 routines for converting arbitrary integers to ASCII decimal strings
1) unsigned
2) signed
3) unsigned/signed mode-selectable

IntExp_1:
arbitrary integer exponential routine demo

EDIT: May 2, 2013
added Evr1 - real number evaluation utility
« Last Edit: May 03, 2013, 02:15:28 AM by dedndave »

jj2007

  • Member
  • *****
  • Posts: 11551
  • Assembler is fun ;-)
    • MasmBasic
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #1 on: June 06, 2012, 04:57:22 AM »
Dave,
My math is not advanced enough for such stuff, but if you decide to open a startup together with Rui (Calcula), Ray (FpuLib) and qWord (SimpleMath), then I volunteer for the publicity part :biggrin:

dedndave

  • Member
  • *****
  • Posts: 8829
  • Still using Abacus 2.0
    • DednDave
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #2 on: June 06, 2012, 08:49:35 AM »
those guys are whizzes - lol
i got these done by brute force effort and a bunch of time   :P
« Last Edit: January 06, 2013, 01:48:28 PM by dedndave »

RuiLoureiro

  • Member
  • ****
  • Posts: 819
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #3 on: June 07, 2012, 01:38:41 AM »
Dave,
I like "Ling Long Kai Fang" !
Where did you see those names ?
Are you taking too much beers, Dave? :badgrin:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8497
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #4 on: June 07, 2012, 01:41:06 AM »
Rui, I think it has some to do with the guys who designed the algo.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

dedndave

  • Member
  • *****
  • Posts: 8829
  • Still using Abacus 2.0
    • DednDave
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #5 on: June 07, 2012, 02:40:40 AM »
 :biggrin:

i couldn't wait for someone to ask that question - lol

it's mentioned here
http://en.wikipedia.org/wiki/Zhu_Shijie

this is the guy that named it
http://en.wikipedia.org/wiki/Qin_Jiushao

it means something like "polynomial ladder solution"

it is an earlier name for Horner's Rule
http://en.wikipedia.org/wiki/Horner%27s_method

and - yes - too many beers   :badgrin:

RuiLoureiro

  • Member
  • ****
  • Posts: 819
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #6 on: June 07, 2012, 04:08:24 AM »
Hi Hutch,  :t
         
Dave,
       i was only kidding.
       In any way, now i know what it mean.
       yes, i need some beers too !  :badgrin:

dedndave

  • Member
  • *****
  • Posts: 8829
  • Still using Abacus 2.0
    • DednDave
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #7 on: June 07, 2012, 09:47:09 AM »
time to open another ling long beer, eh   :t

i have learned some things since i wrote those routines
i may take  look at them to see if they could be improved upon

i might mention - they use no FPU/MMX or SSE registers
i know they could be faster if those instruction sets were used

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8497
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #8 on: June 07, 2012, 11:27:06 AM »
haha, pisspots. REAL asm prgrammers drink Pure Malt[tm].  :P
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

dedndave

  • Member
  • *****
  • Posts: 8829
  • Still using Abacus 2.0
    • DednDave
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #9 on: June 07, 2012, 12:15:28 PM »
Pure ????
that would probably taste like caca - lol

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8497
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #10 on: June 07, 2012, 12:26:55 PM »
I guess that is what you would expect from a beer drinker  :P.  Pure Malt[tm] is what you get when you distill malted barley rather than brew it. I would not wash my socks in most beers, full of chemicals and other crap, at least Pure malt distilled in Scotland is free of the crap in beer.

I have a number of Malts that are 100 proof (50% alcohol by volume) which should never be drunk in volume unless you intend to end up in the horizontal position (floorboarded).  :biggrin:
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

dedndave

  • Member
  • *****
  • Posts: 8829
  • Still using Abacus 2.0
    • DednDave
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #11 on: June 08, 2012, 12:42:12 AM »
back in the day, we could get Foster's here that was just as it was sold in Australia
now days, you can only get the import variety which is 6% or something   :(

dedndave

  • Member
  • *****
  • Posts: 8829
  • Still using Abacus 2.0
    • DednDave
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #12 on: May 03, 2013, 02:13:52 AM »
i have added a new attachment to the first post of the thread
happy ling long kai fang !   :biggrin:

Code: [Select]
C:\ > Evr
Evr: Ling Long Kai Fang Real Number Evaluation Utility
DednDave  5-2013  Ver 1.0

  This program evaluates hexadecimal Intel real numbers from the command line.
     The characters 0-9, A-F, P, X, and S are read, all others are ignored.
  This allows the use of spaces, underscores, etc, to separate the hex digits.
 If the number of hex digits doesn't total 8, 16, or 20, this message is shown.
           The P switch may be used to show values at full Precision.
   The X switch may be used to show values with 3 eXtra digits of precision.
                      The X switch overrides the P switch.
      The S switch may be used to Step the LSB, showing 3 adjacent values.
               (d) = Denormal               (p) = Pseudo-Denormal

                    Example: Evr 4000 C90F DAA2 2168 C235 xs

                         Press any key to continue ...
Code: [Select]
C:\ > Evr 4000 C90F DAA2 2168 C235 xs

4000_C90FDAA2_2168C234: +3.14159265358979323829597

4000_C90FDAA2_2168C235: +3.14159265358979323851281

4000_C90FDAA2_2168C236: +3.14159265358979323872965
Code: [Select]
C:\ > Evr 4000C90FDAA22168C235p

4000_C90FDAA2_2168C235: +3.14159265358979323851280895940618620443274267017841339111328125
Code: [Select]
C:\ > Evr 0000_80000000:00000000 s

0000_7FFFFFFF_FFFFFFFF: +3.3621031431120935059e-4932 (d)

0000_80000000_00000000: +3.36210314311209350626e-4932 (p)

0000_80000000_00000001: +3.36210314311209350663e-4932 (p)
Code: [Select]
C:\ > Evr 00000000 00000000 s

80000000_00000001: -4.9406564584124654e-324 (d)

00000000_00000000: +0

00000000_00000001: +4.9406564584124654e-324 (d)
Code: [Select]
C:\ > Evr FF800000 s

FF7FFFFE: -3.40282326e+38

FF7FFFFF: -3.40282347e+38

FF800000: -∞

anunitu

  • Member
  • *****
  • Posts: 1151
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #13 on: May 03, 2013, 09:28:39 AM »
yeh Hutch real malts are the sipping kind not the shoot it down kind. In tiny little glasses to boot. and of course with your pinkie turned up like a real gent.... :t

Magnum

  • Member
  • *****
  • Posts: 2363
Re: Ling Long Kai Fang Bignum to ASCII
« Reply #14 on: May 03, 2013, 09:44:43 AM »
It uses 50% cpu on my system.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org