Cody

Problem 47123. Determine the Base of the Equation Provided

Solution 3473964

Submitted on 29 Oct 2020 by Tim
  • Size: 169
  • This is the leading solution.
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
eqn = '41/3=13'; base = 8; assert(isequal(base_EXP(eqn),base))

2   Pass
eqn = '23+44+14+32=223'; base = 5; assert(isequal(base_EXP(eqn),base))

3   Pass
eqn = '302/20=12.1'; base = 4; assert(isequal(base_EXP(eqn),base))

4   Pass
eqn='((om*9)^2)/8ct=5cw.vatjd3pc05'; base = 33; assert(isequal(base_EXP(eqn),base))

[Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint4 (line 3) In solutionTest (line 9)]

5   Pass
eqn='(23a*d88-d4h+6de-b1c*1i7)/1i=3ge9.109766ah41'; base = 19; assert(isequal(base_EXP(eqn),base))

[Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint5 (line 3) In solutionTest (line 11)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint5 (line 3) In solutionTest (line 11)]

6   Pass
eqn='((15bd*141)^(1/3)*1c69)^2/24c5e3eb.dfgb3c9ea=4c2.d490201adc'; base=17; assert(isequal(base_EXP(eqn),base))

[Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint6 (line 3) In solutionTest (line 13)]

7   Pass
eqn='10312*112.122222222222-2102*142.4+343*11244.241111111111-120^2.222222222222=10130111.040120200044'; base=5; assert(isequal(base_EXP(eqn),base))

8   Pass
eqn='jn*w.asssssssssss-7p*1b.ssssssssssss+2q*mw.kipx4bipx4bi-z^2.i=1s5w.5uao2dhya6ue'; base=36; assert(isequal(base_EXP(eqn),base))

[Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 17)]

9   Pass
eqn='1111111/111-10101=-m0.mm0mb50leh6i' base=23; assert(isequal(base_EXP(eqn),base))

eqn = '1111111/111-10101=-m0.mm0mb50leh6i' [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint9 (line 3) In solutionTest (line 19)]

10   Pass
eqn='cb/a=16.dddddddddddd'; base=27; assert(isequal(base_EXP(eqn),base))

[Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint10 (line 3) In solutionTest (line 21)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint10 (line 3) In solutionTest (line 21)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint10 (line 3) In solutionTest (line 21)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint10 (line 3) In solutionTest (line 21)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint10 (line 3) In solutionTest (line 21)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint10 (line 3) In solutionTest (line 21)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint10 (line 3) In solutionTest (line 21)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint10 (line 3) In solutionTest (line 21)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint10 (line 3) In solutionTest (line 21)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint10 (line 3) In solutionTest (line 21)] [Warning: Inputs representing integers greater than or equal to flintmax might not be represented exactly as double-precision floating-point values.] [> In base2dec (line 40) In base_EXP (line 11) In ScoringEngineTestPoint10 (line 3) In solutionTest (line 21)]