Cody

Problem 45960. Set the Euler-Mascheroni constant with an identity using available MATLAB functions

Solution 3035434

Submitted on 2 Oct 2020 by James
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
y_correct = 0.5772156649; assert(isequal(EulerMascheroni,y_correct))

gamma = 0.5772

2   Pass
filetext = fileread('EulerMascheroni.m'); summing = ~isempty(strfind(filetext, 'sum')) || ~isempty(strfind(filetext, 'plus')) ||... ~isempty(strfind(filetext, '+')); assert(~summing, 'Please do not sum infinite series')

3   Pass
filetext = fileread('EulerMascheroni.m'); assert(isempty(strfind(filetext, '5772156649')), 'Please do not set the constant directly (or indirectly with arithmetic')

Suggested Problems

More from this Author50

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!