Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
lgas
· 2mo ago · 0 comments
I've never used D, but it appears to be valid syntax.
https://dlang.org/spec/function.html#postconditions
Comments
[–]
diath
2mo ago
I'm not asking about the syntax, I'm asking about the logic where a value can be equal to itself plus another value when the pre-condition is that it must be > 0.
[–]
prydt
2mo ago
The syntax is correct but I made a logical error since balance is being compared to itself (as opposed to the new balance at the end).