Startseite ¦  was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews ¦  sonstiges
kylix ¦  tutorials ¦  online shop ¦  fotos ¦  Add&Win Gewinnspiel


Willkommen Gast. Bitte einloggen oder registrieren.
08.02.2012, 03:20:42
Übersicht Hilfe Suche Einloggen Registrieren

+  SwissDelphiCenter Forum
|-+  English Forums
| |-+  General Forum
| | |-+  Error in Math/How can I...determine if a number is prime, quickly
« vorheriges nächstes »
Seiten: [1] Drucken
Autor Thema: Error in Math/How can I...determine if a number is prime, quickly  (Gelesen 1833 mal)
harleyflanders
Newbie
*
Offline Offline

Beiträge: 3


E-Mail
« am: 31.08.2008, 00:16:08 »

The declaration

function LeastCommonMultiple(Nmbrs: array of Cardinal): Int64;

is illegal in every version of Pascal/Delphi I  have ever heard of.

"array of Cardinal"  is not a type id.
Gespeichert
grenzgaenger
Global Moderator
Full Member
*****
Offline Offline

Beiträge: 232


« Antworten #1 am: 31.08.2008, 01:05:21 »

take a look on this two tips ...


by the way, the cardinal type is a unsinged longint. so you can him replace with a longword or an other cardinal type.

<HTH> GG
Gespeichert
Loïs Bégué
Global Moderator
Hero Member
*****
Offline Offline

Beiträge: 1718



WWW
« Antworten #2 am: 01.09.2008, 10:48:41 »

code modifications:

Code:
Type
  TCardinalArray = array of Cardinal;
...
function LeastCommonMultiple(Nmbrs: TCardinalArray): Int64;
Though, since TCardinalArray is a dynamic array, you'll have to initialize it on your own using "setLength(...)".
Gespeichert

Prof.Y
Arpoon
Seiten: [1] Drucken 
« vorheriges nächstes »
Gehe zu:  


Einloggen mit Benutzername, Passwort und Sitzungslänge

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006, Simple Machines LLC Prüfe XHTML 1.0 Prüfe CSS