How does setrounding work?

setrounding is indeed global, if you want it set temporarily, use the form that takes a function so that the original setting will be restored. See Integers and Floating-Point Numbers · The Julia Language.

Also, please quote your code.

2 Likes