Skip to content

Instantly share code, notes, and snippets.

View thinkphp's full-sized avatar
💭
If I have seen further it is only by standing on the shoulders of giants. Newton

Adrian Statescu thinkphp

💭
If I have seen further it is only by standing on the shoulders of giants. Newton
View GitHub Profile
@thinkphp
thinkphp / e.go
Created March 9, 2017 20:24
Euler's number.
/**
*
* Adrian Statescu (http://adrianstatescu.com)
*
* The number e is a mathematical constant that is the base of the natural logarithm.
* Sometimes called Euler's number.
*
* License MIT
*
*/
@thinkphp
thinkphp / sqrt.c
Created March 14, 2017 06:59
SQRT in C language using Recurrence Relations.
/*
* Adrian Statescu <mergesortv@gmail.com> http://adrianstatescu.com
* Square Root(SQRT) Algorithm using Recurrence relation an+1 = ( an + n / an ) / 2.0;
* MIT License
*/
#include <stdio.h>
#include <math.h>
float mySQRT(float n) {
@thinkphp
thinkphp / sqrt.js
Last active March 14, 2017 09:16
SQuare RooT in JAVASCRIPT
/*
* Adrian Statescu <mergesortv@gmail.com> http://adrianstatescu.com
* Square Root(SQRT) Algorithm using Recurrence relation an+1 = ( an + n / an ) / 2.0;
* MIT License
*/
DOMhelp = {
addEvent: function(elem,evType,fn,useCapture) {
if(elem.addEventListener) {
@thinkphp
thinkphp / rational.cpp
Last active March 14, 2017 16:52
struct Rational Data Abstract Type
/*
* Adrian Statescu <mergesortv@gmail.com>
* Data Type Abstract Rational
* Ordinateur with Rationals +,-,*,/
*/
#include <iostream>
using namespace std;
typedef struct {
@thinkphp
thinkphp / polynome.c
Last active March 14, 2017 20:54
Derivatives and Polynomials in ANSI C Language
/**
* Adrian Statescu <mergesortv@gmail.com>
* Derivatives and Polynomials.
* MIT License
*/
#include <stdio.h>
#define MAXN 500
void readPolynom(int *n, int vec[]) {
@thinkphp
thinkphp / triangle-pascal.c
Created March 15, 2017 14:48
Pascal's Triangle in C made easy with Dynamic Programming.
/*
* Blaise Pascal's Triangle
*/
#include <stdio.h>
#define MAXN 20
int main() {
int n,
@thinkphp
thinkphp / sqrt.go
Created March 15, 2017 21:17
Computes SQuar RooT (SQRT) using recurrence relations.
/**
*
* Adrian Statescu (http://adrianstatescu.com)
*
* Computes SQuar RooT (SQRT) using recurrence relations.
*
* anplus1 = ( an + n / an ) / 2
*
* License MIT
*
@thinkphp
thinkphp / triangle-pascal.go
Created March 16, 2017 08:04
Pascals Triangle in Golang.
/**
*
* Adrian Statescu (http://adrianstatescu.com)
*
* Pascal's Triangle
*
* License MIT
*
*/
package main
@thinkphp
thinkphp / combination.go
Created March 16, 2017 08:22
Combinations using Pascal's Triangle.
/**
*
* Adrian Statescu (http://adrianstatescu.com)
*
* Comb using Pascal's Triangle
*
* License MIT
*
*/
package main
@thinkphp
thinkphp / sqrt.rb
Created March 16, 2017 09:21
SQuare RooT in Ruby.
#
# Adrian Statescu <mergesortv@gmail.com>
# This Method Computes SQuare RooT in Ruby.
# MIT License
#
def sqrt(n)
an = n / 2.0