Top

$factors(N) <- return N factors (3 formats)


mIRC Code
+ 0 likes
Please Register to submit score.
Average Score  3.0
Scores Submitted  1
Date Added  Jun 14, 2008
Last Updated  Jun 14, 2008
Tags  custom  factor  identifier  math  mirc  number 
  Bookmark and Share

Introduction

Returns the Factors of N
Factors: Numbers which multiplied by another number go into the target.
e.g. 12 (1 x 12), (2 x 6), (3 x 4) = 12
1,12,2,6,3,4 are factors of 12

; Usage: $factors(N).P
; 'P' above can be: List (List factors) || group (factors grouped like (F,F)) || num (Number of factors)
; Example I: $factors(2).list <--- Returns 1 2
; Example II: $factors(15).group <--- Returns (1,15) (3,5)
; Example III: $factors(372).num <--- Returns 12

I searched around and couldn't find an in-built function for this (I hope there isn't one now I've made it!)

Grab the Code

Comments

  (0)  RSS

Please Register or Login to start posting comments.
Bottom