[Community Puzzle] Decimal numbers to floating numbers - Puzzle discussion

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @JDOnline,validated by @Dr_Meyss,@Eulero314 and @NicolasAlmerge.
If you have any issues, feel free to ping them.

After implementing the algorithm, all tests are passing.
After submitting, two validators are KO, notably validator 4.
Some tips to help me investigate?

Of course, using native C# classes like BitConverter makes everything work perfectly fine, but that defeats the purpose of the game.

Why the last two test cases the same?
3.5e-5

And there are no negative test cases.

1 Like

Indeed twice the same test is a mistake. I just changed it and put it as a negative number.
Thanks for your comments.

1 Like

Can you show me the result you have on your side to compare and try to help you ?

Hi,

I have an issue with validator 8, is there any specificity on this one versus the other validators and all IDE tests ?

Thank you

The input to the validator 8 (Scientific notation (2)) is:
[a positive integer greater than 9]e[a negative integer].

Not sure if there is any other specificity.

Ok thank you,
This should be written [dec.unit] e [the index placed in the validator +1]. Anyhow, Iā€™ll check if I have something wrongly managed in this case.

I have not the result of the validator after submittingā€¦or is there a way to get it?

From the RESULTS button to the left of the puzzle statement, click MY REPORT, then DETAILS.

Iā€™ve passed all the test cases but failed Validator 9. Any clues about that validator, please?

I donā€™t see anything special about Validator 9, except for having 5 decimal places before ā€œeā€: the input is in the format of x.xxxxxe+x.

Weird. Iā€™m parsing the number into a Python decimal, so there should be no scope for precision loss. Back to the drawing boardā€¦ (Great puzzle, by the way)

I was failing validator 2 (Simple integer) despite passing everything else. Turns out there is a trailing endline (ā€˜\nā€™) in the input that messed up my NaN detection.

1 Like

Fixed. Thank you for reporting.

1 Like