2012-02-07から1日間の記事一覧

コイン投げ #9

C

Cに移し変えるなら、GMPとMPFRの両ライブラリを使うのがいいと思う*1。 精度に関する心配を減らせる上に便利な関数も用意されている。 #include <stdio.h> #include <gmp.h> #include <mpfr.h> int prob(mpfr_t p, unsigned int a, unsigned int b); int prob(mpfr_t p, unsigned int</mpfr.h></gmp.h></stdio.h>…