Das folgende Beispiel stammt von Bernd Herrmann:

 

Mit dieser Funktion können Sie jede beliebige Zahl in Ihre Primfaktoren zerlegen:

 


Function PFZ(zahl)

Application.ScreenUpdating = False

zahl = Fix(zahl)

If zahl = 1 Then

PFZ = zahl

Else

If zahl < 1 Then

PFZ = "#WERT!"

Else

While zahl <> 1

For i = 2 To zahl

prim = zahl Mod i

If prim = 0 Then

zahl = zahl / i

PFZ = PFZ & "*" & i

Exit For

End If

Next i

Wend

PFZ = mid(PFZ, 2)

End If

End If

End Function

 

Aus der Zahl 12345 folgt z. B. das Ergebnis 3*5*823.

This website uses cookies to manage authentication, navigation, and other functions. By using our website, you agree that we can place these types of cookies on your device.