Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/MathlibTest/     Datei vom 15.10.2026 mit Größe 202 B image not shown  

Quelle  BinaryRec.lean   Sprache: Lean

 

module

public import Mathlib.Data.Nat.Bits

def Nat.popcountTR (n : Nat) : Nat :=
  n.binaryRec (·) (fun b _ f x ↦ f (x + b.toNat)) 0

/-- info: 1 -/
#guard_msgs in
#eval Nat.popcountTR (2 ^ 20240)

Messung
CHZG
929810096

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland