Not sure what you would need this for but this is how you take the data of the variable $result from the operation function to your shortcode:
operation();
function operation(){
$result=5+1;
return $result;
}
function my_function(){
$result = operation();
return (string)$result;
}
add_shortcode( 'my-shortcode', 'my_function' );