Script Library: 1240 scripts

# Discussion posts for script bignumbers.r

1
guest2
27-Mar-2007 17:16
Edited:
guest2
27-Mar-2007 17:19
```hello
yes it works,  but it is very slow even if the code was optimized.

there is better ways, search on Internet for some good theories:

and have a look on what follows:

[code]
mul: func [n1 n2 /local tmp res len a b c d][

; n1 * n2 can be decomposed in four numbers, following the formula
(a + b) * (c + d).

; The goal is to decompose them into smaller numbers (recursivly)
until we can use the native mult operation
; of rebol.

; Then, the big number is rebuild by addition and concatenation of
intermediate results.
len: max length? n1 length? n2
if len < 5 [return to string! (to integer! n1) * to integer! n2]
res: cp ""
if 0 = len: min 4 min length? n1 length? n2 [return ""]
a: cp/part n1 (length? n1) - len
b: at n1 (length? n1) - len + 1
c: cp/part n2 (length? n2) - len
d: at n2 (length? n2) - len + 1
res: mul b d
tmp: add mul a d mul c b

either len < length? res [tmp: add tmp cp/part res (length? res)
- len][insert/dup res "0" len - length? res]
res: append tmp at res (length? res) - len + 1
tmp: mul a c
len: len * 2

either len < length? res [tmp: add tmp cp/part res (length? res)
- len][insert/dup res "0" len - length? res]
append tmp at res (length? res) - len  + 1
]

add: func [n1 n2 /local len tmp res a b c d][

; same as above, n1 and n2 are decomposed in smaller numbers, recursivly
until Rebol can operate them nativly.

if 10 > max length? n1 length? n2 [return to string! (to integer!
n1) + to integer! n2]

if 0 = len: min 9 min length? n1 length? n2 [return either empty?
n1 [n2][n1]]
a: cp/part n1 (length? n1) - len
b: at n1 (length? n1) - len + 1
c: cp/part n2 (length? n2) - len
d: at n2 (length? n2) - len + 1

either len < length? res [tmp: add tmp "1" remove res][insert/dup
res "0" len - length? res]
append tmp res
]
[/code]```
2
johnsjvi95
24-May-2021 3:31

# I am a begginer in this field and I am having a hard time in doing some scripts. Thank you for sharing this.

## Contents:

Hayward Concrete Contractor

MakeDoc2 by REBOL- 24-May-2021
3
narinder
22-Oct-2021 3:40

# free guest posting sites list

## Contents:

MakeDoc2 by REBOL- 22-Oct-2021
4
mark214
20-Nov-2021 19:46

# Love this post. Thank you. Painting services Santa Rosa

## Contents:

MakeDoc2 by REBOL- 20-Nov-2021
5
marosol
10-Dec-2021 1:51

# It works for me too. Thank you.

## Contents:

carpet cleaning allentown pa

MakeDoc2 by REBOL- 10-Dec-2021
6
crutcherhuyn
28-Feb-2022 20:21

# It really works. Thank you.

## Contents:

drywall repair

MakeDoc2 by REBOL- 28-Feb-2022
7
marie
16-Mar-2022 8:24

# I appreciate the wonderful information. I hope that there's more to come.

## Contents:

foundation repair contractor

MakeDoc2 by REBOL- 16-Mar-2022
8
johnsjvi95
8-Apr-2022 22:20

# The big number is rebuild by addition and concatenation of intermediate results.

## Contents:

TV Mounting

MakeDoc2 by REBOL- 8-Apr-2022
9
joeanderson
11-Apr-2022 16:33

# Nowadays, searching on the internet for better codes is also a good thing. The learning never stops. :)

## Contents:

Joe from DC Drywall Contractors

MakeDoc2 by REBOL- 11-Apr-2022
10
ampva301
21-Jun-2022 19:21

I am new to this industry and am having difficulty with some scripts. Thank you for bringing this to our attention. I appreciate it really.

https://www.drywallproscleveland.com

11
janwil
19-Jul-2022 11:06

# It's nice to see this awesome post here. tile cleaning west jordan ut

## Contents:

MakeDoc2 by REBOL- 19-Jul-2022
12
johnsjvi95
22-Jul-2022 6:17

# We are here to meet whatever requirements you may need for the type of event you have.

## Contents:

sailcloth tent rental

MakeDoc2 by REBOL- 22-Jul-2022
13
26-Jul-2022 1:33

# Very much appreciated that you take the time to share this with us. Cincinnati SEO agency

## Contents:

MakeDoc2 by REBOL- 26-Jul-2022
14
saruonhosari
17-Aug-2022 0:31

# We also offer many different services, including semi truck engine repair, commercial truck suspension repair, air conditioning service, semi trick air brake service, and many more.

## Contents:

A/C Repair Service milwaukee

MakeDoc2 by REBOL- 17-Aug-2022
15
frances1234
22-Aug-2022 21:20

# If you're getting a NA result from the preceding line, turning off scientific notation may help spin the wheel. The command to use for this is "base options."

## Contents:

MakeDoc2 by REBOL- 22-Aug-2022
16
ficode
21-Nov-2022 3:33

# Ficode Technologies Limited is a leading software development company in the United Kingdom focused on delivering best custom website development servicesto our customers.

## Contents:

MakeDoc2 by REBOL- 21-Nov-2022
17
mandiripinja
5-Dec-2022 7:50

pinjaman dana jaminan bpkb mobil cepat hanya 1 hari bisa langsung cair dengan suku bunga rendah serta tanpa survey dan bpkb mobil aman untuk seluruh wilayah indonesia.

https://www.justgiving.com/fundraising/mandiripinjamandana

https://ameblo.jp/mandiripinjamandana/entry-12680765607.html

https://ameblo.jp/mandiripinjamandana/entry-12680767540.html

https://ameblo.jp/mandiripinjamandana/entry-12680769727.html

https://ameblo.jp/mandiripinjamandana/entry-12680770493.html

https://ameblo.jp/mandiripinjamandana/entry-12680771364.html

https://ameblo.jp/mandiripinjamandana/entry-12680785558.html

https://ameblo.jp/mandiripinjamandana/entry-12680786359.html

https://ameblo.jp/mandiripinjamandana/entry-12680787122.html

https://ameblo.jp/mandiripinjamandana/entry-12680787855.html

https://ameblo.jp/mandiripinjamandana/entry-12680788647.html

https://ameblo.jp/mandiripinjamandana/entry-12680789550.html

https://ameblo.jp/mandiripinjamandana/entry-12680790188.html

https://ameblo.jp/mandiripinjamandana/entry-12680790735.html

https://ameblo.jp/mandiripinjamandana/entry-12680791419.html

https://ameblo.jp/mandiripinjamandana/entry-12680792163.html

https://ameblo.jp/mandiripinjamandana/entry-12680792608.html

https://ameblo.jp/mandiripinjamandana/entry-12680793459.html

https://ameblo.jp/mandiripinjamandana/entry-12680793916.html

https://ameblo.jp/mandiripinjamandana/entry-12680794272.html

https://ameblo.jp/mandiripinjamandana/entry-12680794619.html

https://ameblo.jp/mandiripinjamandana/entry-12680794959.html

https://ameblo.jp/mandiripinjamandana/entry-12680795284.html

https://ameblo.jp/mandiripinjamandana/entry-12680795637.html

18
crutcherhuyn
20-Dec-2022 22:37

# We understand the importance of keeping your truck running smoothly, so we’ll work diligently to get your truck back on the road as soon as possible.

## Contents:

https://mobiletruckrepairstockton.com/

MakeDoc2 by REBOL- 20-Dec-2022
19
emmausa
14-Feb-2023 0:03

Your post's format is amazing and engaging! I appreciate how valuable and instructive it is, and I look forward to your next message. https://krunkergame.co

20
wellwell38
20-Feb-2023 2:24
Edited:
wellwell38
20-Feb-2023 2:26

The information you share is very good so I am very curious about your next posts. https://lolbeans-io.com/

21
johnsjvi95
13-Mar-2023 7:06

# We are dedicated to keeping your car on the road and running smoothly, and we will always go above and beyond to make sure you are satisfied with the work we do.

## Contents:

Cedar Park Towing Company

MakeDoc2 by REBOL- 13-Mar-2023
22
crutcherhuyn
13-Mar-2023 17:36

# We also offer emergency brake repairs.

## Contents:

Warwick Onsite Truck Repair

MakeDoc2 by REBOL- 13-Mar-2023
23
blythewoody
1-Apr-2023 1:32

# Hello! It's great to hear that you've reviewed the script and found it functional, but you're right that there may be more efficient algorithms out there for performing multiplication and addition of large numbers.

## Contents:

The code you've provided is implementing a recursive approach to decomposing the numbers into smaller pieces that can be handled natively by Rebol. This is a common technique used in large number arithmetic, and can certainly be more efficient than straightforward long multiplication or addition algorithms.

However, it's worth noting that there are many existing libraries and modules for handling large number arithmetic in a variety of programming languages, which may be more efficient and thoroughly tested than rolling your own implementation.

That being said, if you're interested in exploring more efficient algorithms for large-number arithmetic, I would recommend starting with some research into the Karatsuba algorithm and the Toom-Cook algorithm. These are both widely-used techniques for multiplying large numbers that can be more efficient than traditional long multiplication.

I hope this helps! Let me know if you have any further questions. Cincinnati SEO expert

MakeDoc2 by REBOL- 1-Apr-2023
24
5-Apr-2023 5:39

# Thank you for the suggestion! However, I would like to clarify that the code I provided was not intended to be an optimized solution for multiplication, but rather a simple example of how to implement a multiplication function using recursion in Python.

## Contents:

That being said, I appreciate your code and I believe it could be helpful for those looking for a more optimized solution for multiplication. Realtors in Miami

MakeDoc2 by REBOL- 5-Apr-2023
25
miyaka22
29-Feb 0:09

# We are your go-to choice for all of your needs in the plumbing and HVAC industries because of our versatility, which enables us to provide a wide range of these services.

## Contents:

MakeDoc2 by REBOL- 29-Feb-2024
26
annafaaster
8-May 6:09
```Probably every person who is interested in their health has at least
once heard such a phrase as ‘hormonal optimisation’. After all,
hormones are very important in any person's body. I found a great
article on this https://ways2well.com/blog/what-is-hormone-optimization-understanding-the-basics-and-beyond
site where I learned about what hormone optimisation is. Thanks to
this information, I understood what hormonal imbalance is and what
hormonal optimisation is for. I think this information can be helpful
to many people. Read this information on the website if you want
to know more about hormonal optimisation.```