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
/* This divides an n-word dividend by an m-word divisor, giving an | |
n-m+1-word quotient and m-word remainder. The bignums are in arrays of | |
words. Here a "word" is 32 bits. This routine is designed for a 64-bit | |
machine which has a 64/64 division instruction. */ | |
import std.stdio; | |
import std.algorithm : max; | |
int nlz(uint x) { | |
int n; |
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 MIT License (MIT) | |
Copyright (c) 2015 ueshita, e10s | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
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
/* | |
Copyright electrolysis 2015. | |
Distributed under the Boost Software License, Version 1.0. | |
(See copy at http://www.boost.org/LICENSE_1_0.txt) | |
*/ | |
// A simple program to print whether a CD tray is ejectable, on FreeBSD. | |
#include <stdio.h> | |
#include <string.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
/* | |
Copyright electrolysis 2015. | |
Distributed under the Boost Software License, Version 1.0. | |
(See copy at http://www.boost.org/LICENSE_1_0.txt) | |
*/ | |
// A simple program to print whether a CD tray is open or closed, on FreeBSD. | |
#include <stdio.h> | |
#include <string.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
/* | |
Copyright electrolysis 2015. | |
Distributed under the Boost Software License, Version 1.0. | |
(See copy at http://www.boost.org/LICENSE_1_0.txt) | |
*/ | |
module curry; | |
import std.traits : arity; |