re: https://plutus.readthedocs.io/en/latest/plutus/tutorials/basic-apps.html
Given that the explanation is ""The validator checks that the transaction, represented by scriptContextTxInfo, pays half the specified amount to each recipient.", why does the code not simply use ==half
in both cases?
validateSplit :: SplitData -> () -> ScriptContext -> Bool
validateSplit SplitData{recipient1, recipient2, amount} _ ScriptContext{scriptContextTxInfo} =
let half = Ada.divide amount 2 in
Ada.fromValue (valuePaidTo scriptContextTxInfo recipient1) >= half &&
Ada.fromValue (valuePaidTo scriptContextTxInfo recipient2) >= (amount - half)```