Silent FishDev

Financial & Rounding Semantics · Delphi → C# / Java / C++

Delphi System.Round banker's rounding and silent uses shadowing.

Financial and ERP migrations rarely fail on whole dollars — they fail on half-cent tie-breaking and silent identifier shadowing hidden in a unit's uses clause.

Two separate traps around Round(x)

  1. 01 · Banker's rounding (half to even) under default FPU modeSystem.Round(2.5) = 2 and System.Round(3.5) = 4. That matches C# default Math.Round(x) (MidpointRounding.ToEven), but silently diverges from C++ std::round (half away from zero) and Java Math.round (half toward +∞). Worse: Delphi's rounding mode can also be mutated at runtime via System.Math.SetRoundMode (Contract Dimension #2: hidden external FPU state).
  2. 02 · Silent shadowing via the uses clauseIn Delphi, later units in uses shadow earlier ones (including System). If a legacy helper unit declares its own commercial half-up function Round(Value: Double): Int64;, every unqualified Round(x) in that unit silently stops calling System.Round — and an AI agent reading a single procedure out of context will port the wrong rounding law!

Verification checklist before porting financial code

Verify it yourself in Delphi 13 (Free < 1 MB Demo)

Every rule in these guides comes from 879 build observations and 650 executable runs on Delphi 13 Community Edition (Win32, Win64, and compile-only Android ARM). The free demo on GitHub includes the complete 74-chapter & 89-directive Table of Contents, 6 multi-difficulty excerpts, 4 complete directive cards, 8 compiler JSON receipts, 6 runnable .dpr probes, and working plugins, skills, and local offline MCP server.

Get Full Universal Suite · from $99Inspect Free Demo on GitHubAll Technical Guides

Honest scope boundaries: Strictly a Delphi / Object Pascal language, runtime-behavior, and compiler-directive reference — not a VCL, FMX, or FireDAC component API encyclopedia. Does not claim 100% coverage of the language or any ABI; open questions are listed explicitly by name. Independent product, not affiliated with Embarcadero Technologies, Inc.