$frac()
mIRC Code
+ 0 likes
Please Register to submit score.
| Average Score | 0.0 (of 0 scores) |
| Date Added | May 12, 2009 |
| Last Updated | May 13, 2009 |
| Tags | awesome. buddha converter decimal editor firstmate frac fraction god hawkee inputoutput jesus math mirc mp3 mymother playlist |
Introduction
Turns decimals into fractions. yay
Sample output:
| Code: |
$div(.5) -> 1/2 $div(.333) -> 1/3 $div(1.5) -> 3/2 $div(.342857) -> 12/35 |
A note on the number of significant figures. When doing something like 12/35 where the number of sigfigs is exactly 6, try to use 6. On numbers such as 1/3 where its continuous, it's recommended to use 4.
mIRC Snippet:
$frac()
Posted on May 13, 2009 11:13 am
Posted on May 13, 2009 11:13 am
hi
sorry about my language i don't speak verry well english
no need to "return $false"
u was declared %p local why u retype var %p down? type only %p = ...
the variable %y and %t just for len of number after the point?
put only "%t $mid($1,$pos($1,.,1),0) - 1"
no need $round($1,%t) type only $1 cz the %t is the len of number after the point
so
sorry about my language i don't speak verry well english
no need to "return $false"
u was declared %p local why u retype var %p down? type only %p = ...
the variable %y and %t just for len of number after the point?
put only "%t $mid($1,$pos($1,.,1),0) - 1"
no need $round($1,%t) type only $1 cz the %t is the len of number after the point
so
| Code: |
| alias frac { var %x 1,%t $mid($1,$pos($1,.,1),0) - 1,%p while (%x) { %p = $round($calc($v1 * $1),0) if ($round($calc($+(%p,/,$v1)),%t) == $1) return $+(%p,/,%x) inc %x } } |








