-0.0##
under NegativeLiterals+MagicHash yields positive 0.0##
.
Fragile to negative zero and infinity and NaN (LitFloat
/LitDouble
cannot express them). cf. #9811, #18897.
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/mman.h> // mmap, mprotect, munmap | |
#include <unistd.h> | |
typeof(int (*)(int)) adder(int y) | |
{ | |
void *mem = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); | |
if (mem == MAP_FAILED) { |
function newPromptTag() | |
return {} | |
end | |
local sk_meta = {} | |
local function runWithTag(tag, co, ...) | |
local status, a, b, c = coroutine.resume(co, ...) | |
if status then | |
if a == "return" then | |
return b | |
elseif a == "capture" then |
import timeit | |
from typing import Tuple | |
def naive_fib(n: int) -> int: | |
if n <= 1: # n == 0 or n == 1 | |
return n | |
else: | |
return naive_fib(n - 1) + naive_fib(n - 2) | |
print(naive_fib(20)) |
\documentclass{article} | |
\usepackage{amsmath} | |
\usepackage{luacode} | |
\begin{document} | |
\begin{luacode*} | |
local M = require "expr" | |
function diff(expr, var) | |
local result = M.parse(expr) | |
if result.tag == "Ok" then | |
local e = M.simplify(M.diff(var)(result.payload)) |
local assert = assert | |
local error = error | |
local getmetatable = getmetatable | |
local pairs = pairs | |
local pcall = pcall | |
local setmetatable = setmetatable | |
local math = math | |
local math_abs = math.abs | |
local math_type = math.type | |
local math_maxinteger = math.maxinteger |
#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}, |
#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; |
{-# 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 |
// 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 |