� � � � � � � � �
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VennDiagram[n_, ineqs_: {}] := Module[{i, r = .6, R = 1, v, x, y, f}, | |
v = Table[Circle[r {Cos[#], Sin[#]} &[2 Pi (i - 1)/n], R], {i, n}]; | |
{ | |
If[ineqs == {}, {}, | |
f = And @@ (v /. Circle[{xx_, yy_}, rr_] :> (x - xx)^2 + (y - yy)^2 < rr^2)[[ineqs]]; | |
RegionPlot[ImplicitRegion[f, | |
{x, y}], Axes -> False, | |
DisplayFunction -> Identity][[1]] | |
], | |
v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//On Ubuntu, you need: | |
//sudo apt-get install libboost-dev | |
#include <iostream> | |
#include <cmath> | |
#include <ctime> | |
#include <boost/multiprecision/cpp_bin_float.hpp> | |
using namespace std; | |
using namespace boost::multiprecision; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
<dependencies> | |
<dependency> | |
<groupId>org.apfloat</groupId> | |
<artifactId>apfloat</artifactId> | |
<version>1.8.2</version> | |
</dependency> | |
</dependencies> | |
*/ | |
import org.apfloat.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Pre build: sudo apt-get install libboost-dev | |
//To build: g++ quad.cpp -lquadmath | |
#include <cmath> | |
#include <ctime> | |
#include <quadmath.h> | |
#include <boost/multiprecision/cpp_dec_float.hpp> | |
using namespace std; | |
namespace mp = boost::multiprecision; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//On Ubuntu, you need to install CUDA and: | |
//sudo apt-get install libboost-dev | |
//On Windows, I don't know the way to build this code. | |
#include <iostream> | |
#include <iomanip> | |
#include <cmath> | |
#include <cuda_runtime.h> | |
#include <boost/multiprecision/cpp_dec_float.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//On Ubuntu, you need to install CUDA and: | |
//sudo apt-get install libboost-dev | |
//On Windows, I don't know the way to build this code. | |
#include <iostream> | |
#include <iomanip> | |
#include <cmath> | |
#include <cuda_runtime.h> | |
#include <boost/multiprecision/cpp_dec_float.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@*The first C program. | |
``\.{hello, world!}''と出力するC言語のプログラムは以下のとおり。 | |
@c | |
@<Header files to include@>@/ | |
@<The main program@> | |
@ 標準入出力のためのライブラリを利用するようにコンパイラに指示する。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ hello, world! と出力するC言語のプログラムは以下のとおり。 | |
@c | |
@<Header files to include@>@/ | |
@<The main program@> | |
@ 標準入出力のためのライブラリを利用するようにコンパイラに指示する。 | |
@<Header files to include@>= | |
#include <stdio.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ hello, world! と出力するC言語のプログラムは以下のとおり。 | |
@c | |
#include <stdio.h> | |
main() | |
{ | |
printf("hello, world\n"); | |
} |