Deutsch English Français Italiano |
<ld9itpFgt18U2@mid.individual.net> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!feeds.phibee-telecom.net!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: vallor <vallor@cultnix.org> Newsgroups: comp.os.linux.advocacy Subject: Re: C Non-Programming Non-Challenge Date: 17 Jun 2024 01:47:37 GMT Lines: 54 Message-ID: <ld9itpFgt18U2@mid.individual.net> References: <17d933d9ffc8ee40$16989$3694546$802601b3@news.usenetexpress.com> <17d943beaefb3aa2$16097$2041738$802601b3@news.usenetexpress.com> <rPadnWt9mtOO9PP7nZ2dnZfqn_qdnZ2d@supernews.com> <ld7lfuF433iU2@mid.individual.net> <666f2f33$0$3102233$882e4bbb@reader.netnews.com> <ld9ct8F8s0rU5@mid.individual.net> <FoGdnfEtJYWlDfL7nZ2dnZfqn_gAAAAA@giganews.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net +i85dg0IVPZr/jTTeqOzkQpi9CG0H5QAlbC0HHDMC9yEkE5BQj Cancel-Lock: sha1:Byh0uTP7HoyalX66U+efPqQM/dE= sha256:7V32kUpjspFugV755yC/ogrmfm01j5QcyxmMVkJQJaA= X-Face: +McU)#<-H?9lTb(Th!zR`EpVrp<0)1p5CmPu.kOscy8LRp_\u`:tW;dxPo./(fCl CaKku`)]}.V/"6rISCIDP` User-Agent: Pan/0.159 (Vovchansk; 873418b; Linux-6.9.4) Bytes: 2769 > vallor wrote: >>> On 6/16/2024 4:19 AM, vallor wrote: >>>>> On Jun 15, 2024 at 3:20:19 PM EDT, "Farley Flud" <ff@linux.rocks> >>>>> wrote: >>>>> >>>>>> On Sat, 15 Jun 2024 14:29:04 +0000, Farley Flud wrote: >>>>>> >>>>>> >>>>>>> Write a C program to compute the subfactorial of an integer N. >>>>>>> >>>>>>> >>>>>> Nobody got it (as predicted). >>>>> >>>>> Because no one bothered. >>>> >>>> I actually took the opportunity to install the GMP documentation on my >>>> system, look up what a "subfactorial" is, and do an implementation that >>>> works for !N where N is 0 through 50. >>> >>> Where's your code? >> >> https://github.com/vallor/subfactorial/ >> >> $ ./try_mpz >> 0:1 >> 1:0 >> 2:1 >> 3:2 >> 4:9 >> 5:44 >> 6:265 >> 7:1,854 >> [...] >> 48:4,566,824,330,931,624,695,767,452,273,778,667,071,025,042,534,230,906,772,538,913 >> 49:223,774,392,215,649,610,092,605,161,415,154,686,480,227,084,177,314,431,854,406,736 >> 50:11,188,719,610,782,480,504,630,258,070,757,734,324,011,354,208,865,721,592,720,336,801 >> >> (I wrote a function to format the numbers.) >> > this is not advocacy , you're off topic Au contraire, Monseur -- showing off the capabilities of the GNU Multi-precision library highlights the easy of numeric computation on LINUX. And my quick-and-dirty formatter fills in a deficiency in gmp_printf() -- it doesn't grok "'" for a format specifier for mpz entities. Show your mom! 🖖️👽️ -- -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti OS: Linux 6.9.4 Release: Mint 21.3 Mem: 258G