This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <string.h> | |
#include <math.h> | |
#include <float.h> | |
#include <inttypes.h> | |
#if defined(TEST_FLOAT128) | |
// For _Float128 type, see TS 18661-3 | |
// For _Float128 support on GCC, see https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html#Floating-Types |
This file contains hidden or 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
#include <math.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
struct fma_test_case_d | |
{ | |
double a, b, c, expected; | |
} static const cases_d[] = { | |
{0x1p1000, 0x1p1000, -INFINITY, -INFINITY}, | |
{-0x1.4f8ac19291ffap1023, 0x1.39c33c8d39b7p-1025, 0x1.ee11f685e2e12p-1, 0x1.2071b0283f156p-1}, |
This file contains hidden or 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
{-# LANGUAGE MagicHash #-} | |
module IntegerToInt where | |
import GHC.Integer.GMP.Internals (Integer (S#)) | |
-- import GHC.Num.Integer (Integer (IS)) | |
import GHC.Exts (Int (I#)) | |
-- Like Data.Bits.toIntegralSized, but optimized for Integer and Int | |
integerToIntMaybe :: Integer -> Maybe Int | |
integerToIntMaybe (S# x) = Just (I# x) | |
-- integerToIntMaybe (IS x) = Just (I# x) |
This file contains hidden or 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
#include <stdio.h> | |
#include <math.h> | |
#include <inttypes.h> | |
#if defined(__GNUC__) | |
#define NOINLINE __attribute__((noinline)) | |
#else | |
#define NOINLINE | |
#endif |
This file contains hidden or 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
#include <stdint.h> | |
#include <float.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <fenv.h> | |
#pragma STDC FENV_ACCESS ON | |
#if defined(__x86_64__) && defined(__GNUC__) | |
#define HAS_X87 | |
static void set_x87_prec_24(void) |
This file contains hidden or 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
// ==UserScript== | |
// @name AtCoder Code Prettify | |
// @namespace https://miz-ar.info/ | |
// @include https://atcoder.jp/contests/*/submissions/* | |
// @version 3 | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
console.debug("AtCoder Code Prettify is running"); |
This file contains hidden or 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
// Written by @mod_poppo | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <mpfr.h> | |
#include <gmp.h> | |
static void to_normalized_hex(char *buf, mpfr_t a, int mant) | |
{ | |
// assume a is positive |
This file contains hidden or 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
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE TypeOperators, NoStarIsType #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-} | |
{-# OPTIONS_GHC -fplugin GHC.TypeLits.KnownNat.Solver #-} | |
module Sing where | |
import qualified Data.Singletons.Prelude as S |
This file contains hidden or 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
#include <M5Stack.h> | |
#include <utility/M5Timer.h> | |
const int SHUTTER_PIN = 12; | |
const int FOCUS_PIN = 5; | |
const int LEVER_UP = 13; | |
const int LEVER_PUSH = 0; | |
const int LEVER_DOWN = 34; |
This file contains hidden or 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
#include <cblas_openblas.h> | |
#include <stdio.h> | |
#include <math.h> | |
int main(void) | |
{ | |
double A[3][3] = { | |
{1.0, 2.0, 3.0}, | |
{2.0, 3.0, 4.0}, | |
{4.0, 5.0, 6.0}, |