Cody

Problem 2392. Find the coefficient of a number in scientifc notation

Solution 2114912

Submitted on 2 Feb 2020 by Asif Newaz
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
[C,E] = scientific_notation(1); assert(abs(C-1)<10^(-10) & isequal(E,0))

2   Pass
[C,E] = scientific_notation(100); assert(abs(C-1)<10^(-10) & isequal(E,2))

3   Pass
[C,E] = scientific_notation(.0055); assert(abs(C-5.5)<10^(-10) & isequal(E,-3))

4   Pass
[C,E] = scientific_notation(3^20); assert(abs(C-3.486784401)<10^(-10) & isequal(E,9))