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
def is_fibonacci?(i) | |
sum = [0,1] | |
x = 0 | |
y = 0 | |
while sum.max <= i | |
sum.length.times do |a| | |
x = sum[a] + sum[a-1] | |
end |
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
/* Based on | |
* - EGM Mathematical Finance class by Enrique Garcia M. <egarcia@egm.co> | |
* - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1) | |
*/ | |
var ExcelFormulas = { | |
PVIF: function(rate, nper) { | |
return Math.pow(1 + rate, nper); | |
}, |
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
// * iOS zooms on form element focus. This script prevents that behavior. | |
// * <meta name="viewport" content="width=device-width,initial-scale=1"> | |
// If you dynamically add a maximum-scale where no default exists, | |
// the value persists on the page even after removed from viewport.content. | |
// So if no maximum-scale is set, adds maximum-scale=10 on blur. | |
// If maximum-scale is set, reuses that original value. | |
// * <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=2.0,maximum-scale=1.0"> | |
// second maximum-scale declaration will take precedence. | |
// * Will respect original maximum-scale, if set. | |
// * Works with int or float scale values. |