Sha256: d2b0859d940da6c91cffe666195876472419e1c9efae204b040e8652edc89d61
Contents?: true
Size: 562 Bytes
Versions: 105
Compression:
Stored size: 562 Bytes
Contents
unit uArmstrongNumbers; interface uses System.SysUtils, System.Math; function isArmstrongNumber(aNumber: integer): Boolean; implementation function isArmstrongNumber(aNumber: integer): Boolean; var wrkNumber: integer; Calculation: integer; valLength: integer; begin wrkNumber := aNumber; Calculation := 0; valLength := aNumber.ToString.Length; while wrkNumber > 0 do begin Calculation := Calculation + trunc(IntPower((wrkNumber mod 10), valLength)); wrkNumber := wrkNumber div 10; end; result := aNumber = Calculation; end; end.
Version data entries
105 entries across 105 versions & 1 rubygems