Welcome To Snipplr
Everyone's Recent Snippets Tagged number
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
An example of Karatsuba algorithm for multiplication of n digit numbers.
0
885
posted 13 years ago by josepino
This simple function allows you to find a weeks position in the month based on a given date. For instance I needed to alert the user their date was the "Second Week Of January" during a given month. I may never use it again but it came in very hand...
0
3174
posted 13 years ago by aristoworks
Full credit for this goes to Deva Raj (@nsdevaraj). This is also a good function for doing a similar thing, http://snipplr.com/view/27954/as3-convert-a-number-to-a-string/
2
1165
posted 13 years ago by adrianparr
I needed to split a decimal number into the integer part and the fraction part and save both of them in different variables
0
1454
posted 13 years ago by bwangila
From the tutorial, Validating Various Input Data in Flash (http://active.tutsplus.com/tutorials/actionscript/validating-various-input-data-in-flash/)
1
1103
posted 13 years ago by Activetuts
This seems to be a bug.. or not..
But explains how to fix it anyway.
0
825
posted 13 years ago by godstroke
Sometimes you need to tween a number (for example from 1-100) and to get the number
1
803
posted 13 years ago by burnandbass
it parses given string and returns 1st number it encounters ( it will replace comas with dots so floats formatted as 12,345 could be 12.345 ( some countries use that ) )
then u can parse returned value as a number / float / int - do what You need...
0
893
posted 14 years ago by stryju
Will help convert string to number OR get number in a selected string.
0
838
posted 14 years ago by carbonr
<p>This function returns a random number within a range.</p><p>For example:</p><p>// assigns low and high values for range</p><p><code>int rangeLow = 34, rangeHigh = 78;</code></p><p>// computes a random number between 34 and 78</p><p><code>myRandomN...
0
757
posted 14 years ago by dblandin
The player selects a range from 0 to n, remembers a number in this range and then the script asks the player a question trying to guess the number. The PC will always guess the correct number.\r\n\r\nI could have added more varied questions, but the...
0
646
posted 14 years ago by Sverri
A simple PHP application for counting how many views a page gets.
0
719
posted 14 years ago by FelixT
Simple function to return a decimal value between the minValue and the maxValue.
0
1710
posted 14 years ago by Jamie
Simple function to return a value between the minValue and the maxValue.
0
806
posted 14 years ago by Jamie
Always need one of these on hand. Feed it a minimum number and a maximum number and it returns a random within that range. Super useful.
1
890
posted 14 years ago by IsoJon
This returns a string with a single space after the fifth character.
Useful for displaying a UK mobile number which is easy to read.
0
975
posted 14 years ago by adrianparr