3と-3のみで乱数を生成したい場合などの実装例(C言語/あくまで一例)
int rndnum = rand() % 2 * ( 3 * 2 ) - 3;
More than 5 years have passed since last update.
3と-3のみで乱数を生成したい場合などの実装例(C言語/あくまで一例)
int rndnum = rand() % 2 * ( 3 * 2 ) - 3;
Register as a new user and use Qiita more conveniently