Was calculated . Hirohito had given the order to fight on the beaches , on the streets ..like Ukraine ..fighting for their homeland . US had to finish the job but would've cost a lot more US lives ... they thought a helluva lot more . (Jap lives too but not sure that was factored into their thinking .) So they decided to display their enormous and unbeatable power .
So I can see the rationale for doing it , at a time btw when no-one else had a nuke so no escalation . But I do have a problem with a couple of things about how it was done . They could've been more specific as to location in the leaflet drop . They really should've had a bigger gap before Nagasaki . and It did set a precedent .
So you have to look at it in the context of it being very new and at the end of a very bad war against a hated enemy . But IMO still could've been done better and with less casualties .