|
|
Subscribe / Log in / New account

Concurrency in Julia

Concurrency in Julia

Posted Nov 12, 2021 6:29 UTC (Fri) by rsidd (subscriber, #2582)
In reply to: Concurrency in Julia by droundy
Parent article: Concurrency in Julia

Even for factorial, the parameter type can be anything, the function body can convert it to bigint if needed.

julia> function factorial(n::Integer)
           return prod(1:convert(BigInt,n))
       end
factorial (generic function with 1 method)

julia> factorial(convert(Int32,100))
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds