# Programming-Idioms #### History of Idiom 31 > diff from v44 to v45

Edit summary for version 45 :
[Rust] Removed pub

#### Version 44

2019-07-06, 11:24:07

#### Version 45

2019-07-06, 11:24:52

# Idiom #31 Recursive factorial (simple)

Create recursive function f which returns the factorial of non-negative integer i, calculated from f(i-1)

# Idiom #31 Recursive factorial (simple)

Create recursive function f which returns the factorial of non-negative integer i, calculated from f(i-1)

##### Code
```pub fn factorial(num: u64) -> u64 {
match num {
0 => 1,
1 => 1,
_ => factorial(num - 1) * num,
}
}```
##### Code
```fn factorial(num: u64) -> u64 {
match num {
0 => 1,
1 => 1,
_ => factorial(num - 1) * num,
}
}```
{"ft_lang_label":"__label__en","ft_lang_prob":0.65366334,"math_prob":0.9499619,"size":670,"snap":"2020-45-2020-50","text_gpt3_token_len":216,"char_repetition_ratio":0.14414415,"word_repetition_ratio":0.6101695,"special_character_ratio":0.39253733,"punctuation_ratio":0.12686567,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97129166,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-26T00:59:54Z\",\"WARC-Record-ID\":\"<urn:uuid:f3f34fbd-12ae-48c5-9c68-eee2ffb517c5>\",\"Content-Length\":\"8216\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ff91c021-cc66-4d81-a709-134dd54c106e>\",\"WARC-Concurrent-To\":\"<urn:uuid:80034abf-5524-4f86-a0e5-44dde831f31a>\",\"WARC-IP-Address\":\"172.217.7.211\",\"WARC-Target-URI\":\"https://www.programming-idioms.org/idiom/31/diff/44/45\",\"WARC-Payload-Digest\":\"sha1:WHMC7653ALSNKKPQOBA7NVPP4QK6MOU3\",\"WARC-Block-Digest\":\"sha1:VITRV4W26WERTWBKRVRTD5YBWRVDDZ7Z\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107890108.60_warc_CC-MAIN-20201026002022-20201026032022-00541.warc.gz\"}"}