The BigInteger in C#

preview_player
Показать описание

See our other Step by Step video series below :-

The BigInteger in C#
Рекомендации по теме
Комментарии
Автор

In Youtube Platform, I don't any other channel that produces great content better than you
"Mr. Shiva Prasad". (y)

mdalaminmahamud
Автор

I'm so bad at C # that I didn't think of it. Thanks a lot!

ЮрийЛипко
Автор

There was a problem on codechef at some point, and this class would have been useful :) Thanks!

proka
Автор

10, 000! is a 35, 000+ digit number (Stirling's Approximation)
Mind blown.
( I scanned the output by pausing the video a few times, and sure enough, the program calculated the absolutely correct value for the integer 10, 000! )
( Joking aside, you actually could do a consistency check by considering all the multiple of 5 and 10 from 1 to 10, 000, and so determining how many initial zeros 10, 000! should have.)
( There's more than sufficient powers of 2 to match each multiple of 5, but it would be a non-trivial calculation because things like 25 produce a 0 as expected when multiplied by 2, but they "return" a new 5 (2*25 = 50), and so eventually accounts for two zeros, not one (4*25 = 100). Likewise, 125 * 8 = 1000, and so the 125 factor in 10, 000! accounts for 3 initial zeros in the final result.)

mathboy
Автор

my life has just gotten easier.. thank you!

LawnMeower
Автор

I have faced this question in my C# interview, at that time I have no clue thanks for clarification.

khiladibabu
Автор

If i get the value returned as System.Numerics.BigInteger instead of a number, does that mean it's too big of number or do i need to access it a different way ?

crimson_star
Автор

Exactly what i was looking for, thanks

hoomanhajiabadi
Автор

It's 2019 and this video is still very useful, thanks!

carlovelasquez
Автор

Thank you very simple and specific. Keep the videos coming.

tjrff
Автор

wht is the diff between BigInterger and int64??
... i think BigInterger's underlaying type is int64 ... and for int64 you do not need to add seprate assembly to your program

plazmaonfly
Автор

Thank you, that's useful, but, please, never multiply by 1 ! (You should better start your for-cycle from 2)

cvany-lachmatul
Автор

It could be nothing, but all of those 0's a the end of your result look suspicious. Perhaps it's just the result.

DamienSawyer
Автор

I tested with some inputs and it is unable to compute more than fact(30000). But Overall the experience was awesome.

mdalaminmahamud